Skip to content

Pip 21 performs one unneeded fetch when -U is supplied #9516

Closed
@callegar

Description

@callegar

Environment

  • pip version: 21.0
  • Python version: 3.8.5
  • OS: ubuntu linux 20.04 (actually, kubuntu)

Description

See the following example:

(Py3.8-devel) user@host:~$ pip install -U cvxopt
Requirement already satisfied: cvxopt in ./PythonEnvs/Py3.8-devel/lib/python3.8/site-packages (1.2.5)
Collecting cvxopt
  Downloading cvxopt-1.2.5-cp38-cp38-manylinux1_x86_64.whl (11.7 MB)
     |████████████████████████████████| 11.7 MB 3.0 MB/s 
  Downloading cvxopt-1.2.4-cp38-cp38-manylinux1_x86_64.whl (11.6 MB)
     |████████████████████████████████| 11.6 MB 41.7 MB/s

Why is cvxopt being collected and downloaded if the requirement about it is already satisfied?
Why is the past version of cvxopt also being downloaded?

I have the suspicion that this may have something to do with the fact that I have the package cache disabled with no-cache-dir = false in pip.conf and that the cache code has been refactored in this version.

Expected behavior

If a requirement is satisfied, then pip should not download anything. If a requirement is not satisfied, pip should download its code at the required version only.

How to Reproduce

  • Disable the pip cache (probably needed)
  • Install a package (e.g., cvxopt)
  • Try to install it again with pip -install -U

Output

Requirement already satisfied: cvxopt in ./PythonEnvs/Py3.8-devel/lib/python3.8/site-packages (1.2.5)
Collecting cvxopt
  Downloading cvxopt-1.2.5-cp38-cp38-manylinux1_x86_64.whl (11.7 MB)
     |████████████████████████████████| 11.7 MB 3.0 MB/s 
  Downloading cvxopt-1.2.4-cp38-cp38-manylinux1_x86_64.whl (11.6 MB)
     |████████████████████████████████| 11.6 MB 41.7 MB/s

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugA confirmed bug or unintended behavior

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions