Home > Software design >  Tensorflow pip install on mac with python3
Tensorflow pip install on mac with python3

Time:12-27

I know this has been asked many times, I saw them tried to solve my problem but I can't, nothing works for me.

  • I have a mac m1, My os version is BigSur 11.5.1
  • My python3 version is 3.8.10
  • I have a project folder, which I created my env in there as atai_env
  • I ran pip upgrade, my pip version is current which is 21.3.1
  • I activated my env and ran pip install tensorflow which gives this error;

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

ERROR: No matching distribution found for tensorflow

  • I saw some command as pip install tensorflow-macos so I tried it, it seems to install but at the end it gives this Failed to build h5py which I tried to install but failed again
  • Then I tried to ran pip command given here for python 3.8 -> https://www.tensorflow.org/install/pip and it gives below error;

tensorflow-2.7.0-cp38-cp38-macosx_10_11_x86_64.whl is not a supported wheel on this platform.

I am so sick of this :/ I tried to install other versions of python but it always fails. Can someone explain what should I do, I can't believe I spent more than 2 hours on this. On the tensorflow install page, it seems I should only be running pip install tensorflow but that doesn't work

CodePudding user response:

Ok, Nothing that I found on google helped. I started over, and decided to try python versions starting from 3.9 with decreasing versions. Finally this command just worked -> pip install tensorflow with python 3.7.9 It is so frustrating, cost me a few hours. I wasn't expecting it would be unstable like this. Anyway, if you happen to face it just try to use one of the version 7 even tho tensorflow says it works for 3.7 - 3.9

PS: I am sorry but this is really stupid, it is almost 2022 and we are working on AI with this framework comon :/

CodePudding user response:

I have MacOS BigSur 11.6.1 running and just created a virtualenv with Python 3.8.12. Installing tensorflow works without any problems:

pip install tensorflow

pip install tensorflow                                                                                                                                           1 err | 8s | voice_assistant py 
Collecting tensorflow
  Downloading tensorflow-2.7.0-cp38-cp38-macosx_10_11_x86_64.whl (207.1 MB)

CodePudding user response:

You can try upgrading the version of pip.

  • Related