pip
pip copied to clipboard
Download multiple versions of the installation package problem
Description
In past versions of pip, when using pip install -r requirements.txt -U
, pip would automatically download the latest version of each package, and only one. But in pip==22.1.2, for example: when tensorflow>=2.4.1
appears in requirements.txt, pip will download all tesensorflow packages of versions 2.4.1-2.9.1, which leads to Occupation and waste, how to solve this problem?
Expected behavior
No response
pip version
22.1.2
Python version
3.8.0
OS
ubuntu 20.04
How to Reproduce
requirements.txt: tensorflow>=2.4.1
pip install -r requirements.txt -U
Output
No response
Code of Conduct
- [X] I agree to follow the PSF Code of Conduct.
I am seeing it attempt to install all
versions of a package if no version specified. I'm not sure if this is a more broad issue or along the same lines as what is included in your example @Zengyf-CVer
Given tensorflow versions 2.4.0, 2.3.0, 2.2.0
When requirements specify simply tensorflow
Then pip 21.1.2 attempts to resolve conflicts and install all 3 versions of tensorflow
@clowtown
This phenomenon does not only occur in tensorflow
, such as scikit-learn
, matplotlib
, etc. It also occurs, which annoys me.
It’s due to backtracking, yes. The alternative would be to delete all other packages and only keep the one that does not cause conflicts; would that be more desired?
Also could you clarify what does “past versions of pip” include? This helps narrow down the affected versions—whether the issue is specific to 21.1.2, or only the 21.1 series, or earlier versions.
@uranusjr I'm not sure which version of pip was in the past, at least the pip I used two months ago is still normal. Can you fix this issue in the next version? Because the latest version of pip will keep downloading all versions of the package in a given range, this is a very annoying bug.
If the issue is urgent to you, feel free to look into it and submit a fix.
Can you share the output of performing this `pip install, as well as contents of any inputs (eg: requirements.txt files) that you feed into the pip install command?
It would help us understand what exactly pip is doing, and what behaviour you are seeing.
Closing this out due to lack of a response.