pypa / pip

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

inconsistent version for every package #10929

Closed Silur closed 2 years ago

Silur commented 2 years ago

Description

Running python -m pip install <any package> results in pip trying to downgrade versions until it runs out of them, thinking the metadata is in conflict even though they are of the same version in the error message.

Tried reinstalling python + pip on my Arch x64 already, issue persists for every package

Expected behavior

pip should install a package successfully

pip version

pip 21.0 from /usr/lib/python3.10/site-packages/pip (python 3.10)

Python version

Python 3.10.2

OS

Arch Linux

How to Reproduce

python -m pip <any package>

Output

https://asciinema.org/a/bKM5F5PidbwktgRXoEUqGbR2u

Code of Conduct

uranusjr commented 2 years ago

This looks like something wrong in your local environment. You’ll need to try reproducing this in a clean environment for anyone (other than you) to investigate. I don’t get the same with a clean ArchLinux image.

TomasDrozdik commented 2 years ago

I face the same issue, pasting the output since the warning suggests some inverted logic:

$ pip install --no-cache-dir --disable-pip-version-check --upgrade pip
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pip in /usr/lib/python3.10/site-packages (21.0)
Collecting pip
  Downloading pip-22.0.4-py3-none-any.whl (2.1 MB)
     |████████████████████████████████| 2.1 MB 5.2 MB/s            
WARNING: Discarding https://files.pythonhosted.org/packages/4d/16/0a14ca596f30316efd412a60bdfac02a7259bf8673d4d917dc60b9a21812/pip-22.0.4-py3-none-any.whl#sha256=c6aca0f2f081363f689f041d90dab2a07a9a07fb840284db2218117a52da800b (from https://pypi.org/simple/pip/) (requires-python:>=3.7). Requested pip from https://files.pythonhosted.org/packages/4d/16/0a14ca596f30316efd412a60bdfac02a7259bf8673d4d917dc60b9a21812/pip-22.0.4-py3-none-any.whl#sha256=c6aca0f2f081363f689f041d90dab2a07a9a07fb840284db2218117a52da800b has inconsistent version: filename has '22.0.4', but metadata has '22.0.4'
  Downloading pip-22.0.4.tar.gz (2.1 MB)
     |████████████████████████████████| 2.1 MB 50.1 MB/s            
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
WARNING: Discarding https://files.pythonhosted.org/packages/33/c9/e2164122d365d8f823213a53970fa3005eb16218edcfc56ca24cb6deba2b/pip-22.0.4.tar.gz#sha256=b3a9de2c6ef801e9247d1527a4b16f92f2cc141cd1489f3fffaf6a9e96729764 (from https://pypi.org/simple/pip/) (requires-python:>=3.7). Requested pip from https://files.pythonhosted.org/packages/33/c9/e2164122d365d8f823213a53970fa3005eb16218edcfc56ca24cb6deba2b/pip-22.0.4.tar.gz#sha256=b3a9de2c6ef801e9247d1527a4b16f92f2cc141cd1489f3fffaf6a9e96729764 has inconsistent version: filename has '22.0.4', but metadata has '22.0.4'
  Downloading pip-22.0.3-py3-none-any.whl (2.1 MB)
     |████████████████████████████████| 2.1 MB 47.0 MB/s            
WARNING: Discarding https://files.pythonhosted.org/packages/6a/df/a6ef77a6574781a668791419ffe366c8acd1c3cf4709d210cb53cd5ce1c2/pip-22.0.3-py3-none-any.whl#sha256=c146f331f0805c77017c6bb9740cec4a49a0d4582d0c3cc8244b057f83eca359 (from https://pypi.org/simple/pip/) (requires-python:>=3.7). Requested pip from https://files.pythonhosted.org/packages/6a/df/a6ef77a6574781a668791419ffe366c8acd1c3cf4709d210cb53cd5ce1c2/pip-22.0.3-py3-none-any.whl#sha256=c146f331f0805c77017c6bb9740cec4a49a0d4582d0c3cc8244b057f83eca359 has inconsistent version: filename has '22.0.3', but metadata has '22.0.3'
  Downloading pip-22.0.3.tar.gz (2.1 MB)
     |████████████████████████████████| 2.1 MB 34.6 MB/s            
  Installing build dependencies ... done
  Getting requirements to build wheel ... \^canceled
ERROR: Operation cancelled by user
pradyunsg commented 2 years ago

Can you run pip with -vv?

pradyunsg commented 2 years ago

https://asciinema.org/a/bKM5F5PidbwktgRXoEUqGbR2u

This recording is no longer available.

TomasDrozdik commented 2 years ago

Output of $ pip install --upgrade -vv pip > pip.err.txt 2>&1 pip.err.txt

pradyunsg commented 2 years ago

Using pip 21.0 from /usr/lib/python3.10/site-packages/pip (python 3.10)

This is likely your problem. Can you reproduce this if you use an up-to-date version of pip (22.0.4), instead of a one year old version of pip prior to any bugfixes for that series?

TomasDrozdik commented 2 years ago

Fair enough, I'll try to reinstall it.

Silur commented 2 years ago

@TomasDrozdik indeed it was some weird env edge-case, although I didn't tinker anything with the default arch python-pip installation on my new machine. My solution was:

sudo pacman -Rncs python-pip
python -m ensurepip