Skip to content
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

SyntaxError in python 3.10 #462

Open
ivholmlu opened this issue Aug 22, 2024 · 1 comment
Open

SyntaxError in python 3.10 #462

ivholmlu opened this issue Aug 22, 2024 · 1 comment

Comments

@ivholmlu
Copy link

When calling

pipreqgs . --force

I get this error.
Seems like it is running or generating some python 2 code, considering the print statement lacks parentheses.. Is there a fix/workaround for this?

File "/pathtomyproject/lvenv/lib/python3.10/site-packages/pipreqs/pipreqs.py", line 139, in get_all_imports
tree = ast.parse(contents)
File "/usr/lib/python3.10/ast.py", line 50, in parse
return compile(source, filename, mode, flags,
File "", line 309
print self.entity.table.repr2()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?

@DataEnggNerd
Copy link

This error seems to be produced from the codebase which you are trying to parse. Can you add the complete traceback to help you better?

return compile(source, filename, mode, flags,
File "", line 309 # <<< file name missing in traceback
print self.entity.table.repr2()

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