SRI-CSL / OCCAM

OCCAM: Object Culling and Concretization for Assurance Maximization
BSD 3-Clause "New" or "Revised" License
26 stars 10 forks source link

`razor` pypi package does not work with python3 #38

Closed pnwamk closed 3 years ago

pnwamk commented 3 years ago

The PyPI page for razor suggests it should work with Python 3, but trying to run slash after installing it results in errors:

$ slash
Traceback (most recent call last):
  File "/usr/local/bin/slash", line 5, in <module>
    from razor.slash import entrypoint
  File "/usr/local/lib/python3.8/site-packages/razor/slash.py", line 200
    if policy <> 'none' and \
               ^
SyntaxError: invalid syntax

For this error I believe it's that the <> operator existed as an alternative to != in Python2 but for Python 3 != is the only such comparison operator. I haven't checked for other incompatibilities.

pnwamk commented 3 years ago

This has been made worse given that recent versions of pip have completely dropped support for python 2.7 and introduce some interesting dynamic failures instead.

For anyone reading and curious: on MacOS, first running sudo easy_install pip==20.3.4 (i.e., installing a version of pip that works with python 2.7) and then running python2.7 -m pip install razor successfully has installed razor and the slash command now works as expected so far.

caballa commented 3 years ago

We have just ported razor to python 3.6 Let me know if you encounter any problem.

Thanks for reminding us to port razor!