我最近在我的计算机上安装了Ubuntu 19.04(在该操作系统上是相当新的),并且我正在尝试安装pynusmv软件包以用于大学的一些工作。
但是,通过运行pip3命令来安装它:
pip3 install pynusmv
我得到一个错误列表,安装失败。我已经与其他这样做的人进行了交谈,但没有得到任何错误,所以我对造成它的原因感到困惑。
到目前为止,我唯一能找到的区别是我的同学正在运行Ubuntu 18.04,所以我试图了解问题是否出在那儿。
我尝试了多种方法,例如更新swig和其他参考,更新python和pip3,安装python dev工具;到目前为止,他们都没有工作。
预期结果
Pynusmv安装成功
实际结果
安装失败。这是我每次运行命令时都会得到的日志的一部分:
Collecting pynusmv
Downloading https://files.pythonhosted.org/packages/e0/b5/4c0f4970fefe927280e65f3951b5075da3f9ded2570478734b0e9d3b0f6a/pynusmv-1.0rc8.tar.gz (4.2MB)
|████████████████████████████████| 4.2MB 3.9MB/s
Requirement already satisfied: pyparsing in ./.local/lib/python3.7/site-packages (from pynusmv) (2.4.2)
Building wheels for collected packages: pynusmv
Building wheel for pynusmv (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-jbjepncw/pynusmv/setup.py'"'"'; __file__='"'"'/tmp/pip-install-jbjepncw/pynusmv/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-jd7g3u8c --python-tag cp37
cwd: /tmp/pip-install-jbjepncw/pynusmv/
Complete output (197 lines):
[...]
patch -p0 -N < makefiles.patch
patching file minisat/core/Makefile
patching file minisat/simp/Makefile
touch minisat.patched
make -C minisat
make[2]: Entering directory '/tmp/pip-install-jbjepncw/pynusmv/dependencies/MiniSat/minisat'
cd simp && make lib && ranlib libminisat.a
make[3]: Entering directory '/tmp/pip-install-jbjepncw/pynusmv/dependencies/MiniSat/minisat/simp'
Making dependencies ...
Compiling: Solver_C.or ( Solver_C.C )
Solver_C.C:44:8: error: expected unqualified-id before user-defined string literal
extern "C"void MiniSat_Delete(MiniSat_ptr ms)
^~~~~~~
make[3]: *** [../mtl/template.mk:63: Solver_C.or] Error 1
make[3]: Leaving directory '/tmp/pip-install-jbjepncw/pynusmv/dependencies/MiniSat/minisat/simp'
make[2]: *** [Makefile:28: simp/libminisat.a] Error 2
make[2]: Leaving directory '/tmp/pip-install-jbjepncw/pynusmv/dependencies/MiniSat/minisat'
make[1]: *** [Makefile:41: minisat.built] Error 2
make[1]: Leaving directory '/tmp/pip-install-jbjepncw/pynusmv/dependencies/MiniSat'
make: *** [Makefile:37: minisat.build] Error 2
make: Leaving directory '/tmp/pip-install-jbjepncw/pynusmv/dependencies'
Packing them in a shared library
Copying the result in lib
building 'pynusmv_lower_interface.nusmv.addons_core._addons_core' extension
swigging pynusmv_lower_interface/nusmv/addons_core/addons_core.i to pynusmv_lower_interface/nusmv/addons_core/addons_core_wrap.c
swig -python -py3 -I./dependencies/NuSMV/NuSMV-2.5.4/nusmv -I./dependencies/NuSMV/NuSMV-2.5.4/nusmv/src -I./dependencies/NuSMV/NuSMV-2.5.4/cudd-2.4.1.1/include -o pynusmv_lower_interface/nusmv/addons_core/addons_core_wrap.c pynusmv_lower_interface/nusmv/addons_core/addons_core.i
pynusmv_lower_interface/nusmv/addons_core/addons_core.i:15: Error: Unable to find '../../../dependencies/NuSMV/NuSMV-2.5.4/nusmv/src/utils/defs.h'
pynusmv_lower_interface/nusmv/addons_core/addons_core.i:16: Error: Unable to find '../../../dependencies/NuSMV/NuSMV-2.5.4/nusmv/src/addons_core/addonsCore.h'
error: command 'swig' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for pynusmv
[...]
此后,它尝试清除安装,但收到类似的错误。我还尝试通过错误来欺骗自己,并编辑依赖项中的明显错字,但这也不能解决问题(安装继续进行,但对其进行运行单元测试只会返回错误)。
有没有办法解决这个问题?
答案 0 :(得分:1)
最后,看来问题毕竟出在Python上。 Ubuntu 19.04随附python 3.7,但该库似乎与它不同意。
我在pycharm工作,所以我通过创建虚拟环境并在其中安装python 3.6来解决了。这样,pip3便成功安装了pynusmv。