Search code examples
pythonpip

Not a supported wheel on this platform


I have a wheel that I can install in my host computer, but can not be installed on a docker container. Some details:

  • OS is the same in both (Ubuntu 20.04)
  • Python is the same in both (3.6.15), but have been compiled at different moments (so maybe they have different flags, I can not say)
  • pip is the same in both systems (pip 21.3.1)

I am running the install command with:

pip install ./coverage-5.5-cp36-cp36m-manylinux2010_x86_64.whl

My host system is happy, but the docker container fails with:

ERROR: coverage-5.5-cp36-cp36m-manylinux2010_x86_64.whl is not a supported wheel on this platform.

I would like to know exactly what criteria pip install is using to decide whether the package is installable or not:

  • is it using details about the OS? Which ones? Where are those read from? If I know this, I can understand what is the difference between one system and the other. In my opinion they are identical, but maybe I am missing something
  • is it using details about Python itself, apart from the version? The version is the same, but maybe enabled features are different. How can I check this?

EDIT

After tampering with the pip sources, it seems my wheel is tagged cp36-cp36m-manylinux2010_x86_64 according to pip, but the docker system supports (amongst a gazillion more), cp36-cp36dm-manylinux2010_x86_64. That's the closest one, but there is a d which I do not know what it means.

So now I need to understand the difference between cp36m and cp36dm


Solution

  • cp36dm is the ABI tag, and the d means a debug build. Your docker container seems to be using a debug build of Python 3.6, which is incompatible with C extension code compiled for non-debug builds. (Python 3.8 removes this incompatibility, but you're on 3.6.)