ERROR: (wheel).whl is not a supported wheel on this platform

Question:

I’m trying to build Tensorflow from source (if I install directly it works fine but I’m trying to get AVX2/FMA extensions support as I can’t use CUDA/GPU) and I’m following this tutorial to build Tensorflow 1.15 (which is needed for the project that I use, I can’t use 2.x).

I’ve built Tensorflow successfully, but when I try to install the wheel with pip I get the following error:

ERROR: tensorflow-1.15.5-cp37-cp37m-macosx_11_0_x86_64.whl is not a supported wheel on this platform.

Well, I know what the error means but the problem is that:

The wheel, as implied by the filename, is built for:

  • Python 3.7
  • macOS 11.0
  • x86/64

Which is already what I have (yup, double checked Python version, it’s exactly Python 3.7.9, and no I’m not on M1 if that matters, I’m on Intel Mac). Why am I getting this error message even though I’m on the platform that the wheel is built for?

UPDATE: I’m already on the latest pip as of writing, and I can verify pip and python point to the same version:

(tf) can@can-mbp tensorflow % which pip 
/opt/anaconda3/envs/tf/bin/pip
(tf) can@can-mbp tensorflow % which python
/opt/anaconda3/envs/tf/bin/python
(tf) can@can-mbp tensorflow % pip -V
pip 21.0 from /opt/anaconda3/envs/tf/lib/python3.7/site-packages/pip (python 3.7)
(tf) can@can-mbp tensorflow % python -V
Python 3.7.9
Asked By: Can Poyrazoğlu

||

Answers:

Upon @Axe319’s comment I took a look at https://github.com/apple/tensorflow_macos/issues/46 and seen that simply changing the wheel’s filename’s OS section to 10_9 works. There is probably a bug with parsing macOS 11.0 or Python doesn’t think it supports 11.0 (maybe that particular Python/pip version was before Big Sur was released).

Answered By: Can Poyrazoğlu

FOR MACOS – BIG SUR

I was able to solve this problem when I found that the version of the macOS operating system does not match the version actually recognized by python

I’m using macOS 11.4, the file is with this version. But when typing a command in the terminal, I found that python recognizes 11.0.

python3
from distutils import util
util.get_platform()
>> 'macosx-11.0-arm64'

generated file name:

opencv_python-4.5.2+2344814-cp39-cp39-macosx_11_4_arm64.whl

new file name:

opencv_python-4.5.2+2344814-cp39-cp39-macosx_11_0_arm64.whl

Answered By: luisdemarchi

Make sure the Python version you are using (32/64 bit) does match what the wheel requires 😉

Answered By: Rik Schoonbeek