enzymefinance/oyente

Update to Python 3

Mikerah opened this issue · 7 comments

I noticed while trying to install oyente that it only seems to work for Python 2 which has been deprecated for a few years. Would it be possible to update the code for oyente to work in a Python 3 environment?

The master branch Oyente can run under Python 3 without issue. Although you can see Python 2 syntax, but they are translated when running under Python 3. Can you paste the exact installation steps and error message you saw? I recommend you to build a docker image that is the easiest way to get Oyente working.

@yxliang01 I've also encountered this error. When I pip install oyente, there's this error code:

Collecting oyente
  Downloading oyente-0.2.7.tar.gz (35 kB)
    ERROR: Command errored out with exit status 1:
     command: /home/kaijun/Documents/oyente-evaluation/env/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ze2h3ys5/oyente/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ze2h3ys5/oyente/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-60efm66y
         cwd: /tmp/pip-install-ze2h3ys5/oyente/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-ze2h3ys5/oyente/setup.py", line 10, in <module>
        long_description=open('README.md').read(),
    FileNotFoundError: [Errno 2] No such file or directory: 'README.md'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

The version on Pypi (installed by pip) is very outdated. You should install from this GitHub Repo and it has been working fine for me and my team members.

I hava the same problem,how can I solve it

I can't install web3 by using python2, but the other dependencies need python2 rather than python3. What should I do?

@yxliang01 When installing from this Repo under python 3.7, the installation works fine, but running oyente shows the following error:

> oyente --help
Traceback (most recent call last):
  File "/home/troublor/workspace/oyente/python3.7/bin/oyente", line 5, in <module>
    from oyente.oyente import main
  File "/home/troublor/workspace/oyente/python3.7/lib/python3.7/site-packages/oyente/oyente.py", line 63
    print "======= error ======="
                                ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("======= error =======")?

The bottleneck is z3 dependence on python2,
use docker