pipreqs reporting same module with two versions
- Dominant language
- Python
- Stars
- 7.5k
- Forks
- 424
- PR merge metrics
- No merged PRs in 30d
Description
I ran pipreqs for the first time, and after fixing some syntax errors it found in my code, it spat out a shorter list than I expected (haven't confirmed anything is missing yet), but what really caught my attention was it repeated two modules with two versions.
Output:
```
GitPython==3.1.40
GitPython==3.1.41
jsonpickle==3.0.2
numpy==1.26.4
openpyxl==3.1.2
pandas==2.2.0
platformdirs==4.2.0
PyQt5==5.15.10
PyQt5_sip==12.13.0
PySide6==6.6.0
PySide6==6.6.1
PySide6_Addons==6.6.0
PySide6_Essentials==6.6.0
Requests==2.31.0
```
As you can see, GitPython and PySide6 are both repeated with slightly differing versions.
Output from the terminal:
```
PS C:\FolderName> pipreqs --force
WARNING: Import named "GitPython" not found locally. Trying to resolve it at the PyPI server.
WARNING: Import named "GitPython" was resolved to "GitPython:3.1.41" package (https://pypi.org/project/GitPython/).
Please, verify manually the final list of requirements.txt to avoid possible dependency confusions.
WARNING: Import named "numpy" not found locally. Trying to resolve it at the PyPI server.
WARNING: Import named "numpy" was resolved to "numpy:1.26.4" package (https://pypi.org/project/numpy/).
Please, verify manually the final list of requirements.txt to avoid possible dependency confusions.
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.0" package (https://pypi.org/project/pandas/).
Please, verify manually the final list of requirements.txt to avoid possible dependency confusions.
WARNING: Import named "platformdirs" not found locally. Trying to resolve it at the PyPI server.
WARNING: Import named "platformdirs" was resolved to "platformdirs:4.2.0" package (https://pypi.org/project/platformdirs/).
Please, verify manually the final list of requirements.txt to avoid possible dependency confusions.
WARNING: Import named "PyQt5" not found locally. Trying to resolve it at the PyPI server.
WARNING: Import named "PyQt5" was resolved to "PyQt5:5.15.10" package (https://pypi.org/project/PyQt5/).
Please, verify manually the final list of requirements.txt to avoid possible dependency confusions.
WARNING: Import named "PySide6" not found locally. Trying to resolve it at the PyPI server.
WARNING: Import named "PySide6" was resolved to "PySide6:6.6.1" package (https://pypi.org/project/PySide6/).
Please, verify manually the final list of requirements.txt to avoid possible dependency confusions.
WARNING: Import named "Requests" not found locally. Trying to resolve it at the PyPI server.
WARNING: Import named "Requests" was resolved to "requests:2.31.0" package (https://pypi.org/project/requests/).
Please, verify manually the final list of requirements.txt to avoid possible dependency confusions.
INFO: Successfully saved requirements file in C:\FolderName\requirements.txt
```
While it does say "Please, verify manually the final list of requirements.txt to avoid possible dependency confusions." this is repeated for every version it found, so this is not a useful warning. These warnings seem more like normal operation too, not a warning.
Contributor guide
Research direction
Start by reproducing the reported `pipreqs --force` run and inspect the generated `requirements.txt`, focusing on the duplicate GitPython and PySide6 entries. Verify whether the output contains one entry per module and whether the repeated resolution messages are treated appropriately.
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
- Mostly clear
- Newbie friendliness
- 45/100