bndr / pipreqs

pipreqs - Generate pip requirements.txt file based on imports of any project. Looking for maintainers to move this project forward.
Apache License 2.0
6.38k stars 388 forks source link

Wrong versions of the package are being saved #386

Open Ohnoimded opened 1 year ago

Ohnoimded commented 1 year ago

pandas==1.5.1 Pillow==9.3.0 Pillow==10.0.0 Requests==2.31.0 selenium==4.11.2

Both versions of Pillow are not in my venv. I am only using v10.0.0. Tried pipreqs --clean requirements.txt --force --ignore .venv. But it didn't fix anything.

WARNING: Import named "Pillow" not found locally. Trying to resolve it at the PyPI server.
WARNING: Import named "Pillow" was resolved to "Pillow:10.0.0" package (https://pypi.org/project/Pillow/).
Please, verify manually the final list of requirements.txt to avoid possible dependency confusions.
danielyan86129 commented 12 months ago

Similar issue here. It printed the same warning and added two versions, where the 1st is my installed one and 2nd is not:

WARNING: Import named "Pillow" not found locally. Trying to resolve it at the PyPI server.
DEBUG: Starting new HTTPS connection (1): pypi.python.org:443
DEBUG: https://pypi.python.org:443 "GET /pypi/Pillow/json HTTP/1.1" 301 122
DEBUG: Starting new HTTPS connection (1): pypi.org:443
DEBUG: https://pypi.org:443 "GET /pypi/pillow/json HTTP/1.1" 200 420412
WARNING: Import named "Pillow" was resolved to "Pillow:10.1.0" package (https://pypi.org/project/Pillow/).
...
Pillow==9.4.0
Pillow==10.1.0