i use pipreqs to generate requirements.txt, the generated requirements.txt has a library GitPython
with two versions 3.1.31
and 3.1.32
my command is python3 -m pipreqs.pipreqs $BASEDIR --force
log is:
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.32" package (https://pypi.org/project/GitPython/).
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 ./requirements.txt
generate file is:
GitPython==3.1.31
GitPython==3.1.32
oss2==2.17.0
Requests==2.31.0
when i run install command pip3 install -r ./requirements.txt
i got this error message:
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: GitPython==3.1.31 in /Users/tian/Library/Python/3.8/lib/python/site-packages (from -r ./requirements.txt (line 1)) (3.1.31)
ERROR: Cannot install GitPython==3.1.31 and GitPython==3.1.32 because these package versions have conflicting dependencies.
The conflict is caused by:
The user requested GitPython==3.1.31
The user requested GitPython==3.1.32
To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
is there a way to generate requirement.txt without conflict versions, if not i'll have to remove the conflict version manually