pypa / pip

The Python package installer
https://pip.pypa.io/
MIT License
9.46k stars 3.01k forks source link

pip 20.3.2 eagerly downloads all versions of a package during dependency resolution #9284

Closed gGonz closed 3 years ago

gGonz commented 3 years ago

Environment

Description If you use pip to update requirements after installing 20.3.2 it goes into an infinite loop resolving and downloading previous versions of dependencies.

This happened on our CI environment that took 26 minutes to complete a job that takes no longer than 3, but then we were able to replicate it locally by just telling pip to update himself...

Expected behavior

Dependencies should be resolved without seeking all versions of a package.

How to Reproduce

  1. pip install -U pip to get to 20.3.2
  2. pip install -U pip again

Output

Paste the output of the steps above, including the commands themselves and
pip's output/traceback etc.

First, update pip

$ pip install -U pip
Collecting pip                                                                                            
  Downloading pip-20.3.2-py2.py3-none-any.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB 1.2 MB/s 
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 20.1
    Uninstalling pip-20.1:
      Successfully uninstalled pip-20.1
Successfully installed pip-20.3.2

Then update it again (I had to ctrl+C to stop the loop)

$ pip install -U pip
Requirement already satisfied: pip in /home/ggonz/.pyenv/versions/3.7.2/envs/pip-test/lib/python3.7/site-packages (20.3.2)
Collecting pip
  Using cached pip-20.3.2-py2.py3-none-any.whl (1.5 MB)
  Downloading pip-20.3.2.tar.gz (1.5 MB)
     |████████████████████████████████| 1.5 MB 829 kB/s 
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
  Downloading pip-20.3.1-py2.py3-none-any.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB 835 kB/s 
  Downloading pip-20.3.1.tar.gz (1.5 MB)
     |████████████████████████████████| 1.5 MB 1.2 MB/s 
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
  Downloading pip-20.3-py2.py3-none-any.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB 1.2 MB/s 
  Downloading pip-20.3.tar.gz (1.5 MB)
     |████████████████████████████████| 1.5 MB 718 kB/s 
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
  Using cached pip-20.2.4-py2.py3-none-any.whl (1.5 MB)
  Downloading pip-20.2.4.tar.gz (1.5 MB)
     |████████████████████████████████| 1.5 MB 1.4 MB/s 
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
  Downloading pip-20.2.3-py2.py3-none-any.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB 1.3 MB/s 
  Downloading pip-20.2.3.tar.gz (1.5 MB)
     |████████████████████████████████| 1.5 MB 1.5 MB/s 
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
  Downloading pip-20.2.2-py2.py3-none-any.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB 1.9 MB/s 
  Downloading pip-20.2.2.tar.gz (1.5 MB)
     |████████████████████████████████| 1.5 MB 2.0 MB/s 
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
  Downloading pip-20.2.1-py2.py3-none-any.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB 160 kB/s 
  Downloading pip-20.2.1.tar.gz (1.5 MB)
     |████████████████████████████████| 1.5 MB 44 kB/s 
^C  Installing build dependencies ... canceled
ERROR: Operation cancelled by user
uranusjr commented 3 years ago

It is not broken again. Please read this: https://github.com/pypa/pip/issues/9284#issuecomment-800843707

I’m going to lock this thread to prevent people from asking again.