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.

Cannot install platform-specific wheels with non-python extension binaries on pip>=20.0.0

See original GitHub issue

Environment

  • pip version: 20.0.1
  • Python version: 3.6.4
  • OS: Windows 10 x64

Description It is no longer possible to install platform-specific wheels with non-python extension binaries on pip>=20.0.0. These are wheels that include prebuilt binaries for specific platforms, and ship a Python wrapping layer using for example ctypes or cffi. There is no Python extension, so the wheels are not tied to a specific python version or implementation. The only constraint for these wheels is the platform (OS) and architecture (32 vs 64 bit) because of the prebuilt binaries they ship with.

I’ll use glfw as an example here, but there are certainly others out there. glfw is a package providing ctypes wrappers for prebuilt binaries that are included in the wheel as well. As you can see on their PyPI page, they provide the following packages:

  • glfw-1.10.1-py2.py3-none-macosx_10_6_intel.whl (99.8 kB)
  • glfw-1.10.1-py2.py3-none-manylinux2010_i686.whl (112.7 kB)
  • glfw-1.10.1-py2.py3-none-manylinux2010_x86_64.whl (118.4 kB)
  • glfw-1.10.1-py2.py3-none-win32.whl (496.5 kB)
  • glfw-1.10.1-py2.py3-none-win_amd64.whl (492.5 kB)
  • glfw-1.10.1.tar.gz (26.0 kB)

The platform tags we see here make sense to me: neither the prebuilt binaries contained within the wheels, nor the python wrappers need to be pinned to a specific python implementation, so ‘py2.py3-none’ is accurate. The binaries are restricted to a specific platform, so we do see separate wheels for each of those (win32, win_amd64, manylinux2010_x86_64, etc). This is correct and used to be working.

When I try to install with pip>=20.0.0, it will select the source distribution, and alternatively forcing to install the wheel will fail with the error message ERROR: glfw-1.10.1-py2.py3-none-win_amd64.whl is not a supported wheel on this platform.. Also see “reproduction” below.

After going through the release notes, I am inclined to think the issue is caused by the recently merged https://github.com/pypa/pip/pull/7354

Expected behavior Pip<20.0.0 behavior: the most compatible wheel is selected and installed by pip.

How to Reproduce

  • Install pip>=20.0.0
  • Use the installed version of pip to install glfw
  • Pip will install the source distribution (that doesn’t contain the prebuilt binaries)

Or:

  • Force pip to install the wheel for your platform (i.e. for Windows x64 it’s this link)
  • Wheel is not installed, and you see the error message ERROR: glfw-1.10.1-py2.py3-none-win_amd64.whl is not a supported wheel on this platform..

Output

$ pipenv install pip>=20.0.0
Creating a virtualenv for this project…
Pipfile: C:\Users\korij\dev\test\Pipfile
Using c:\users\korij\appdata\local\programs\python\python36\python.exe (3.6.4) to create virtualenv…
[  ==] Creating virtual environment...Already using interpreter c:\users\korij\appdata\local\programs\python\python36\python.exe
Using base prefix 'c:\\users\\korij\\appdata\\local\\programs\\python\\python36'
New python executable in C:\Users\korij\.virtualenvs\test-SUagSMsE\Scripts\python.exe
Installing setuptools, pip, wheel...done.

Successfully created virtual environment!
Virtualenv location: C:\Users\korij\.virtualenvs\test-SUagSMsE

$ pipenv run pip --version
pip 20.0.1 from c:\users\korij\.virtualenvs\test-suagsmse\lib\site-packages\pip (python 3.6)

$ pipenv run pip install glfw==1.10.1
Collecting glfw==1.10.1
  Downloading glfw-1.10.1.tar.gz (25 kB)
Building wheels for collected packages: glfw
  Building wheel for glfw (setup.py) ... done
  Created wheel for glfw: filename=glfw-1.10.1-py3-none-any.whl size=25667 sha256=29c3f9e8a609b0884a418d13ccbc7b2a9feae3e76a71276111e0673167f68487
  Stored in directory: c:\users\korij\appdata\local\pip\cache\wheels\a0\b4\23\11682f5036ba8a4d9711066c08be9325530f5330930b71b513
Successfully built glfw
Installing collected packages: glfw
Successfully installed glfw-1.10.1

$ pipenv run pip uninstall glfw
Found existing installation: glfw 1.10.1
Uninstalling glfw-1.10.1:
  Would remove:
    c:\users\korij\.virtualenvs\test-suagsmse\lib\site-packages\glfw-1.10.1.dist-info\*
    c:\users\korij\.virtualenvs\test-suagsmse\lib\site-packages\glfw\*
Proceed (y/n)? y
  Successfully uninstalled glfw-1.10.1

$ pipenv run pip install https://files.pythonhosted.org/packages/2a/f2/2d6381ae04caf456b63894278d875f3b6723aad895f0839c39e11e84b0d0/glfw-1.10.1-py2.py3-none-win_amd64.whl
ERROR: glfw-1.10.1-py2.py3-none-win_amd64.whl is not a supported wheel on this platform.

Just wanted to finish this bug report by saying thank you for all your hard work. If possible, I’m willing to help resolve this problem, but I think I should wait to see the response here before I dive in.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:16
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
rchen152commented, Jan 22, 2020

I believe we’re experiencing the same problem with ninja (https://github.com/google/pytype/issues/495). Instead of installing one of the wheels, pip is trying to install the source distribution, which fails with an import error.

1reaction
sbidoulcommented, Jan 22, 2020

Thanks for the detailed bug report. This looks like the same issue as #7626.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pip install and platform specific wheels - python
PIP follows the PEP 425 Use recommendations; this stipulates how a binary distribution wheel is selected. Specifically, pip install will ...
Read more >
How to install, download and build Python wheels
Platform-specific wheels, which contain C extensions, and therefore must be precompiled as binary distributions for a specific Python ...
Read more >
Optimize pip install with wheels
Make sure you install all binary packages from wheels. When “pip install” can't find a wheel, it falls back to installing from source....
Read more >
History - setuptools 65.6.3.post20221216 documentation
Changes in binary extensions (e.g. C/C++), entry-point definitions, dependencies, metadata, datafiles, etc may require a new installation.
Read more >
What Are Python Wheels and Why Should You Care?
env/bin/activate $ python -m pip install -U pip wheel setuptools Successfully ... If you're writing a C/C++ extension, then this could create a...
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