tensorflow: Missing masOS Big Sur build, Could not find a version that satisfies the requirement tensorflow

System information

  • OS Platform and Distribution: masOS Big Sur
  • TensorFlow installed from (source or binary): binary
  • TensorFlow version: 2.3.0
  • Python version: 3.7/3.8
  • Installed using virtualenv? pip? conda?: virtualenv + pip

Describe the problem Could not find a version that satisfies the requirement tensorflow (from versions: none)

Provide the exact sequence of commands / steps that you executed before running into the problem

$ pip install tensorflow
ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)
ERROR: No matching distribution found for tensorflow
$ pip install tensorflow==2.3.0
ERROR: Could not find a version that satisfies the requirement tensorflow==2.3.0 (from versions: none)
ERROR: No matching distribution found for tensorflow==2.3.0
$ pip install /Users/brikerman/Downloads/tensorflow-2.3.0-cp38-cp38-macosx_10_11_x86_64.whl
ERROR: tensorflow-2.3.0-cp38-cp38-macosx_10_11_x86_64.whl is not a supported wheel on this platform.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 12
  • Comments: 20 (2 by maintainers)

Most upvoted comments

@BrikerMan @prouast Same issue here using Pyenv on MacOS 11.0.1, with Python 3.7.9 & 3.8.5.

I also tried running Python installed using brew install python3@7, it still does not work.

you can also patch site-packages/pip/_vendor/packaging/tags.py and patch the version_str:

    version_str, _, cpu_arch = platform.mac_ver()  # type: ignore
    version_str = "10.15"  # add this

Have the same problem not only with tensorflow but also with scikit-learn found some hacks that helps me for now (until we have to wait for pip to fix this issue) https://github.com/scikit-learn/scikit-learn/issues/18861

  1. install python from conda-forge (via miniconda):
  • brew cask install miniconda
  • conda config --add channels conda-forge
  • conda install libpython-static python
  1. create venv with that interpreter (mkvirtualenv dl4cv -p /usr/local/Caskroom/miniconda/base/bin/python)
  2. install tensorflow with pip
  3. profit

I was facing the same problem after I upgraded to macOS Big Sur (11.0.1). I was unable make it work with pyenv as well. Upgrading my local Python build to 3.8.6 solved my problem.

@prouast @chris-moov I just stopped using Pyenv on Big Sur. I used miniconda and it works just fine.

I don’t think this is a bug since Big Sur is a new major release of macOS. The current platform matching behavior for macOS wheels matches the exact major version and will not match wheels built for the platform macosx_10_9_x86_64, which is the platform that tensorflow wheels currently target. I do not understand how changing Python versions would help this problem, since this is the behavior dictated by pip.

To guarantee proper wheel support, tensorfow needs to just reupload existing wheels with macosx_11_0_x86_64 tag and update PyPI publishing pipeline to upload wheels for both major versions.

To mitigate the problem right now, you can download the wheel for macOS 10.x and rename the tag. E.g. for Python 3.7:

$ wget https://files.pythonhosted.org/packages/0d/ea/f936c14b6e886221e53354e1992d0c4e0eb9566fcc70201047bb664ce777/tensorflow-2.3.1-cp37-cp37m-macosx_10_9_x86_64.whl
$ mv tensorflow-2.3.1-cp37-cp37m-macosx_10_9_x86_64.whl tensorflow-2.3.1-cp37-cp37m-macosx_11_0_x86_64.whl
$ pip install ./tensorflow-2.3.1-cp37-cp37m-macosx_11_0_x86_64.whl

I tried installing miniconda, that failed too. I reckon there is a bug in the Python builds in pyenv and/or brew.

I have downloaded Python from python.org and it worked!