BUG: not able to detect local packages
- Dominant language
- Python
- Stars
- 7.5k
- Forks
- 424
- PR merge metrics
- No merged PRs in 30d
Description
I have pandas installed
```
> pip list | grep pandas
pandas 2.2.0
```
but pipreqs is not able to detect it and tries to resolve it via PyPI. Why?
```sh
> pipreqs . --print
INFO: Not scanning for jupyter notebooks.
WARNING: Import named "pandas" not found locally. Trying to resolve it at the PyPI server.
WARNING: Import named "pandas" was resolved to "pandas:2.2.2" package (https://pypi.org/project/pandas/).
Please, verify manually the final list of requirements.txt to avoid possible dependency confusions.
matplotlib==3.8.2
numpy==1.24.1
numpy==1.21.5
pandas==2.2.2
INFO: Successfully output requirements
```
Contributor guide
Research direction
Start by reproducing the reported `pipreqs . --print` command with locally installed pandas, then trace how pipreqs detects imported packages and falls back to PyPI. Done means a locally installed pandas package is detected without the PyPI warning and the generated requirement reflects the local installation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 45/100