marcoeilers / nagini

Nagini is a static verifier for Python 3, based on the Viper verification infrastructure.
Mozilla Public License 2.0
233 stars 8 forks source link

Install instructions no longer work #140

Closed bobismijnnaam closed 4 years ago

bobismijnnaam commented 4 years ago

I wanted to try out Nagini, but I cannot get it to work on Ubuntu 16.04. I followed all the installation steps succesfully (install python3-dev, create a virtualenv), but when I execute nagini I get the following error:

(nagini_env) bobe@lapbobe:~/UNSAFE/dummy/nagini_test
$ ./nagini_env/bin/nagini
Traceback (most recent call last):
  File "./nagini_env/bin/nagini", line 5, in <module>
    from nagini_translation.main import main
  File "/home/bobe/UNSAFE/dummy/nagini_test/nagini_env/lib/python3.5/site-packages/nagini_translation/main.py", line 24, in <module>
    from nagini_translation.analyzer import Analyzer
  File "/home/bobe/UNSAFE/dummy/nagini_test/nagini_env/lib/python3.5/site-packages/nagini_translation/analyzer.py", line 11, in <module>
    import nagini_contracts.io_builtins
  File "/home/bobe/UNSAFE/dummy/nagini_test/nagini_env/lib/python3.5/site-packages/nagini_contracts/io_builtins.py", line 15, in <module>
    from nagini_contracts.contracts import (
  File "/home/bobe/UNSAFE/dummy/nagini_test/nagini_env/lib/python3.5/site-packages/nagini_contracts/contracts.py", line 90, in <module>
    def Forall(domain: Union[Iterable[T], Type[T]],
  File "/usr/lib/python3.5/typing.py", line 552, in __getitem__
    dict(self.__dict__), parameters, _root=True)
  File "/usr/lib/python3.5/typing.py", line 512, in __new__
    for t2 in all_params - {t1} if not isinstance(t2, TypeVar)):
  File "/usr/lib/python3.5/typing.py", line 512, in <genexpr>
    for t2 in all_params - {t1} if not isinstance(t2, TypeVar)):
  File "/usr/lib/python3.5/typing.py", line 1077, in __subclasscheck__
    if super().__subclasscheck__(cls):
  File "/home/bobe/UNSAFE/dummy/nagini_test/nagini_env/lib/python3.5/abc.py", line 225, in __subclasscheck__
    for scls in cls.__subclasses__():
TypeError: descriptor '__subclasses__' of 'type' object needs an argument

I've tried different flags, passing in python files as an argument, and without activating the virtualenv, but this error appears every time. I've also tried the plugin for intellij but the Nagini menu doesn't appear under tools.

Besides the installation steps in the readme, are there any others that I should do? Or is this maybe a known problem?

bobismijnnaam commented 4 years ago

This is because I was running a python3.5 version lower than 3.5.3 (I had 3.5.2). Upgrading to 3.6 got nagini to work (i.e. running virtualenv --python=python3.6 instead of just python3. I installed 3.6 via apt I think).

marcoeilers commented 4 years ago

Thanks, I updated the required version to 3.6 in the README to hopefully avoid that problem in the future.