pipreqs
pipreqs copied to clipboard
SyntaxError in python 3.10
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 "
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()
It's because it's Python 2. Can you upgrade the file maybe?