Skip to content

SyntaxError: invalid syntax running pyt on MacOS Sierra #178

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
greg5678 opened this issue Oct 27, 2018 · 3 comments
Closed

SyntaxError: invalid syntax running pyt on MacOS Sierra #178

greg5678 opened this issue Oct 27, 2018 · 3 comments

Comments

@greg5678
Copy link

greg5678 commented Oct 27, 2018

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
@KevinHock
Copy link
Collaborator

3.6

@greg5678
Copy link
Author

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

@KevinHock
Copy link
Collaborator

(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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants