pip doesn't handle PEP600 compatible manylinux wheels when --platform is specified.
See original GitHub issueDescription
When pip is asked to install or download a manylinux wheel and the --platform
option is specified, it fails to find either tag aliases, or to download an βearlierβ manylinux tag, if there was no exact match.
The manylinux project defines the following legacy aliases in PEP 600:
- manylinux1_x86_64 is now an alias for manylinux_2_5_x86_64
- manylinux1_i686 is now an alias for manylinux_2_5_i686
- manylinux2010_x86_64 is now an alias for manylinux_2_12_x86_64
- manylinux2010_i686 is now an alias for manylinux_2_12_i686
- manylinux2014_x86_64 is now an alias for manylinux_2_17_x86_64
- manylinux2014_i686 is now an alias for manylinux_2_17_i686
- manylinux2014_aarch64 is now an alias for manylinux_2_17_aarch64
- manylinux2014_armv7l is now an alias for manylinux_2_17_armv7l
- manylinux2014_ppc64 is now an alias for manylinux_2_17_ppc64
- manylinux2014_ppc64le is now an alias for manylinux_2_17_ppc64le
- manylinux2014_s390x is now an alias for manylinux_2_17_s390x
β¦ these tags should be equivalent to each other.
In addition, manylinux tags are supposed to be forward compatible - if a particular platform is specified, it should find the βlatestβ tag, if no exact match was found.
Expected behavior
pip downloads a compatible manylinux wheel.
pip version
21.3.1
Python version
3.8.10
OS
Ubuntu 20.04
How to Reproduce
$ python3 -m pip download -d /tmp/d --only-binary :all: --platform manylinux2010_x86_64 numpy==1.19.0
$ python3 -m pip download -d /tmp/d --only-binary :all: --platform manylinux2014_x86_64 numpy==1.19.0
$ python3 -m pip download -d /tmp/d --only-binary :all: --platform manylinux_2_12_x86_64 numpy==1.19.0
$ python3 -m pip download -d /tmp/d --only-binary :all: --platform manylinux_2_17_x86_64 numpy==1.19.0
$ python3 -m pip download -d /tmp/d --only-binary :all: --platform manylinux_2_24_x86_64 numpy==1.19.0
$ python3 -m pip download -d /tmp/d --only-binary :all: --platform manylinux_2_17_x86_64 numpy==1.22.0
$ python3 -m pip download -d /tmp/d --only-binary :all: --platform manylinux_2_24_x86_64 numpy==1.22.0
(The problem affects any wheel on pypi, numpy was just chosen as a well known package)
The first five commands should find the same manylinux2010
wheel, but only the first two commands do so.
The last two commands should find the same manylinux_2_17
wheel, but only the first command does so.
Output
Collecting numpy==1.19.0
Downloading numpy-1.19.0-cp38-cp38-manylinux2010_x86_64.whl (14.6 MB)
|ββββββββββββββββββββββββββββββββ| 14.6 MB 4.5 MB/s
Saved /tmp/d/numpy-1.19.0-cp38-cp38-manylinux2010_x86_64.whl
Successfully downloaded numpy
Collecting numpy==1.19.0
File was already downloaded /tmp/d/numpy-1.19.0-cp38-cp38-manylinux2010_x86_64.whl
Successfully downloaded numpy
ERROR: Could not find a version that satisfies the requirement numpy==1.19.0 (from versions: 1.20.3, 1.21.0rc1, 1.21.0rc2, 1.21.0, 1.21.1, 1.21.2, 1.21.3, 1.21.4, 1.21.5)
ERROR: No matching distribution found for numpy==1.19.0
ERROR: Could not find a version that satisfies the requirement numpy==1.19.0 (from versions: 1.22.0rc1, 1.22.0rc2, 1.22.0rc3, 1.22.0)
ERROR: No matching distribution found for numpy==1.19.0
ERROR: Could not find a version that satisfies the requirement numpy==1.19.0 (from versions: none)
ERROR: No matching distribution found for numpy==1.19.0
Collecting numpy==1.22.0
Downloading numpy-1.22.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.8 MB)
|ββββββββββββββββββββββββββββββββ| 16.8 MB 166 kB/s
Saved /tmp/d/numpy-1.22.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Successfully downloaded numpy
ERROR: Could not find a version that satisfies the requirement numpy==1.22.0 (from versions: none)
ERROR: No matching distribution found for numpy==1.22.0
Code of Conduct
- I agree to follow the PSF Code of Conduct.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:6 (2 by maintainers)
Top GitHub Comments
Folks, PEP-600 was accepted almost 3 years ago. Why does
pip download
not support this functionality yet? Looks like thereβs been some recent movement with PR #10894 but I do not understand the feet-dragging on this. As always I feel like the bad guy for wanting basic functionality out ofpip download
, but I canβt imagine Iβm the only one that wants to download packages for use in an offline foreign environment.The workaround of listing each platform tag separately (2.5 through 2.28 in my case) is really inconvenient. Maybe if I were really fancy with my bash array skills it wouldnβt be, but nothing immediate came to mind for passing all those options.
A workaround is to specify all platforms that the target platform supports. Figuring out that list can be achieved using some variant of the below on the target-platform (and ignoring the message about not automatically parsing):