Problem installing 'pynusmv' on Ubuntu 19.04

344 Views Asked by At

I've recently installed Ubuntu 19.04 on my machine (I'm fairly new at this OS), and I'm trying to install the pynusmv package for some University work.

However, by running the pip3 command to install it:

pip3 install pynusmv

I get a list of errors and the installation fails. I've talked to other people who have done the same but get none of the errors, so I'm confused by what is causing it.

The only difference I can find so far is that my coursemates are running Ubuntu 18.04 instead, so I'm trying to understand if the problem lies there.

I've tried multiple approaches, such as updating swig and other dependencies, updating python and pip3, installing the python dev tools; none of them have worked so far.

Expected result

Pynusmv installation succeeds

Actual results

Installation fails. This is part of the log I get whenever I run the command:

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

[...]

After that, it attempts to clean the installation but gets a similar error. I've also tried to cheat my way through the error, and edit the apparent typo in the dependency, but that doesn't solve the problem either (the installation proceeds, but running unit tests on it only returns errors).

Is there a way to fix this?

1

There are 1 best solutions below

0
On BEST ANSWER

In the end, it seemed the problem was with Python after all. Ubuntu 19.04 comes with python 3.7, and this library doesn't seem to agree with it.

I work in pycharm, so I solved by creating a virtual environment and installing python 3.6 in it. In that, pip3 installed pynusmv without issues.