question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pip doesn't handle PEP600 compatible manylinux wheels when --platform is specified.

See original GitHub issue

Description

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

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:2
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
cdjamesoncommented, Sep 9, 2022

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 of pip 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.

0reactions
vanschelvencommented, Jul 22, 2022

My usecase: I will be running a package on a Linux platform that uses glibc 2.31. I’d like to download a wheel that will be compatible for this platform, so I’d want to run […] and expect that the latest compatible wheel is fetched.

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):

python -m pip debug --verbose | grep cp39-cp39 | awk -F- '{print $3}'
Read more comments on GitHub >

github_iconTop Results From Across the Web

PEP 600: Future 'manylinux' Platform Tags for Portable Linux ...
This PEP proposes a scheme for new 'manylinux' wheel tags to be defined without requiring a PEP for every specific tag, similar to...
Read more >
How does pip decide which many linux wheel to use?
PEP 600 has been designed to be "future-proof" and does not enforce specific symbols and a specific distro to build. It only states...
Read more >
How to install, download and build Python wheels - ActiveState
Pip will install all β€œflavors” of wheels, including: ... Platform-specific wheels, which contain C extensions, and therefore must beΒ ...
Read more >
Options - cibuildwheel - Read the Docs
Execute a shell command to repair each (non-pure Python) built wheel. CIBW_MANYLINUX_*_IMAGE. Specify alternative manylinux Docker images.
Read more >
What's the deal with Python wheels? - Oxford RSE
If you've ever installed a package with pip from the Python Packaging ... The latest manylinux PEP, PEP 600, introduced platform tags of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found