python-security/pyt

SyntaxError: invalid syntax running pyt on MacOS Sierra

greg5678 opened this issue · 3 comments

I'm trying to run pyt on MacOS Sierra and it seemed to install properly with sudo pip3 install python-taint. When I ran pyt against a python file it printed SyntaxError: invalid syntax. Looking at the errors printed I believe it has to do with the python version I have installed.

python --version
Python 2.7.15
python3 --version
Python 3.7.0
Traceback (most recent call last):
  File "/usr/local/bin/pyt", line 11, in <module>
    load_entry_point('python-taint==0.40', 'console_scripts', 'pyt')()
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 476, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2700, in load_entry_point
    return ep.load()
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2318, in load
    return self.resolve()
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2324, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/local/lib/python2.7/site-packages/pyt/__main__.py", line 9, in <module>
    from .analysis.fixed_point import analyse
  File "/usr/local/lib/python2.7/site-packages/pyt/analysis/fixed_point.py", line 3, in <module>
    from .reaching_definitions_taint import ReachingDefinitionsTaintAnalysis
  File "/usr/local/lib/python2.7/site-packages/pyt/analysis/reaching_definitions_taint.py", line 5, in <module>
    from ..core.node_types import AssignmentNode
  File "/usr/local/lib/python2.7/site-packages/pyt/core/node_types.py", line 31
    def __init__(self, label, ast_node, *, line_number=None, path):
                                         ^
SyntaxError: invalid syntax

3.6

How do I set the python version to 3.6? BTW does pty only work with python 2.7 code?

(Apologies for the brief response before, was on my phone.)

PyT only runs on Python 3 code and runs as Python 3. Here is how you can set up a virtualenv for Python3.6, it should work on 3.7 as well.

Cheers,
Kevin