Open nise opened 2 years ago
Faced the same issue in Python 3.10
I found this solution from the CSDN forum (from China) but still, I don't know how to solve it even though I know Mandarin! https://blog.csdn.net/Pragmatism_3568/article/details/105414950
Python 3.7.6 pip 21.3.1
$ python3 -m pipreqs.pipreqs . ERROR: Failed on file: ./metadata-env/lib64/python3.7/site-packages/srsly/tests/ujson/test_ujson.py Traceback (most recent call last): File "/home/abb/Applications/anaconda3/lib/python3.7/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/home/abb/Applications/anaconda3/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/abb/Applications/anaconda3/lib/python3.7/site-packages/pipreqs/pipreqs.py", line 494, in
main() # pragma: no cover
File "/home/abb/Applications/anaconda3/lib/python3.7/site-packages/pipreqs/pipreqs.py", line 488, in main
init(args)
File "/home/abb/Applications/anaconda3/lib/python3.7/site-packages/pipreqs/pipreqs.py", line 418, in init
follow_links=follow_links)
File "/home/abb/Applications/anaconda3/lib/python3.7/site-packages/pipreqs/pipreqs.py", line 131, in get_all_imports
raise exc
File "/home/abb/Applications/anaconda3/lib/python3.7/site-packages/pipreqs/pipreqs.py", line 117, in get_all_imports
tree = ast.parse(contents)
File "/home/abb/Applications/anaconda3/lib/python3.7/ast.py", line 35, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "", line 1
import decimal
^
SyntaxError: invalid character in identifier