在Ubuntu 19.04上安装“pynusmv”时出现问题

2024-05-15 16:55:47 发布

您现在位置:Python中文网/ 问答频道 /正文

我最近在我的机器上安装了ubuntu19.04(我对这个操作系统还比较陌生),我正在尝试为一些大学工作安装pynusmv包。你知道吗

但是,通过运行pip3命令来安装它:

pip3 install pynusmv

我得到一个错误列表,安装失败。我和其他人谈过,他们也做过同样的事情,但没有发现任何错误,所以我对造成错误的原因感到困惑。你知道吗

到目前为止,我能找到的唯一区别是,我的课程材料运行的是ubuntu18.04,所以我试图了解问题是否存在。你知道吗

我尝试过多种方法,比如更新swig和其他dipendency、更新python和pip3、安装python开发工具;到目前为止,这些方法都没有奏效。你知道吗

预期结果

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

[...]

之后,它试图清理安装,但得到了类似的错误。我还试图通过错误欺骗自己,编辑依赖项中的明显错误,但这也不能解决问题(安装继续进行,但对其运行单元测试只会返回错误)。你知道吗

有办法解决这个问题吗?你知道吗


Tags: installpipcoremake错误dependencieslowertmp
1条回答
网友
1楼 · 发布于 2024-05-15 16:55:47

最终,问题似乎还是出在Python身上。 Ubuntu19.04附带了Python3.7,这个库似乎不同意它。你知道吗

我在pycharm工作,所以我通过创建一个虚拟环境并在其中安装python3.6来解决这个问题。在这种情况下,pip3安装pynusmv时没有问题。你知道吗

相关问题 更多 >