pipreqs icon indicating copy to clipboard operation
pipreqs copied to clipboard

SyntaxError: invalid decimal literal

Open syheliel opened this issue 1 year ago • 1 comments

How to reproduce

git clone https://github.com/NVIDIA/cccl.git
cd cccl
pipreqs .

error msg

ERROR: Failed on file: ./libcudacxx/libcxx/utils/generate_feature_test_macro_components.py
Traceback (most recent call last):
  File "/home/xxx/miniforge3/envs/cupy/bin/pipreqs", line 10, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/xxx/miniforge3/envs/cupy/lib/python3.12/site-packages/pipreqs/pipreqs.py", line 528, in main
    init(args)
  File "/home/xxx/miniforge3/envs/cupy/lib/python3.12/site-packages/pipreqs/pipreqs.py", line 455, in init
    candidates = get_all_imports(input_path,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/xxx/miniforge3/envs/cupy/lib/python3.12/site-packages/pipreqs/pipreqs.py", line 131, in get_all_imports
    raise exc
  File "/home/xxx/miniforge3/envs/cupy/lib/python3.12/site-packages/pipreqs/pipreqs.py", line 117, in get_all_imports
    tree = ast.parse(contents)
           ^^^^^^^^^^^^^^^^^^^
  File "/home/xxx/miniforge3/envs/cupy/lib/python3.12/ast.py", line 52, in parse
    return compile(source, filename, mode, flags,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<unknown>", line 36
    "c++14": 201304L
                  ^

syheliel avatar Feb 10 '24 09:02 syheliel

Try upgrading pipreqs, they seemed to have fixed the UTF-8 issue.

pip install pipreqs --upgrade --no-deps
pip install yarg==0.1.9 docopt==0.6.2

This avoids the tons of unnecessary jupyter notebook modules.

vishalnandagopal avatar Feb 25 '24 04:02 vishalnandagopal