bndr / bndr/pipreqs

Error when trying to use

Open
#301 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
7.5k
Forks
424
PR merge metrics
No merged PRs in 30d

Description

```$ pipreqs ./ --ignore .venv```

```
(python) C:\Users\yosty\Desktop\Desktop_Folder\14 - git\dataScripts\Text>pipreqs ./ --ignore .venv
ERROR: Failed on file: ./08_sentiment_analysis_with_bert-ry.py
Traceback (most recent call last):
File "C:\Users\yosty\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\yosty\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\yosty\Envs\python\Scripts\pipreqs.exe\__main__.py", line 7, in
File "c:\users\yosty\envs\python\lib\site-packages\pipreqs\pipreqs.py", line 488, in main
init(args)
File "c:\users\yosty\envs\python\lib\site-packages\pipreqs\pipreqs.py", line 415, in init
candidates = get_all_imports(input_path,
File "c:\users\yosty\envs\python\lib\site-packages\pipreqs\pipreqs.py", line 131, in get_all_imports
raise exc
File "c:\users\yosty\envs\python\lib\site-packages\pipreqs\pipreqs.py", line 117, in get_all_imports
tree = ast.parse(contents)
File "C:\Users\yosty\AppData\Local\Programs\Python\Python39\lib\ast.py", line 50, in parse
return compile(source, filename, mode, flags,
File "", line 73
!pip install -q -U watermark
^
SyntaxError: invalid syntax
```

Not sure how to troubleshoot as an unknown file is the reference? Any help would greatly be appreciated thank you.

Contributor guide

Open the contributing guide

Research direction

Reproduce the reported command with the failing file, 08_sentiment_analysis_with_bert-ry.py, and inspect pipreqs.py around lines 117, 131, and 415 where ast.parse is called. Determine how pipreqs should handle this SyntaxError and confirm the expected behavior with a focused regression test or documented reproduction.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.