pip icon indicating copy to clipboard operation
pip copied to clipboard

Download multiple versions of the installation package problem

Open Zengyf-CVer opened this issue 2 years ago • 7 comments

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

Zengyf-CVer avatar Jul 12 '22 05:07 Zengyf-CVer

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 avatar Jul 12 '22 20:07 clowtown

@clowtown This phenomenon does not only occur in tensorflow, such as scikit-learn, matplotlib, etc. It also occurs, which annoys me.

Zengyf-CVer avatar Jul 12 '22 22:07 Zengyf-CVer

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?

uranusjr avatar Jul 13 '22 01:07 uranusjr

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 avatar Jul 13 '22 01:07 uranusjr

@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.

Zengyf-CVer avatar Jul 13 '22 02:07 Zengyf-CVer

If the issue is urgent to you, feel free to look into it and submit a fix.

uranusjr avatar Jul 13 '22 02:07 uranusjr

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.

pradyunsg avatar Jul 13 '22 08:07 pradyunsg

Closing this out due to lack of a response.

pradyunsg avatar Mar 14 '23 10:03 pradyunsg