-
Notifications
You must be signed in to change notification settings - Fork 308
Tensorflow cannot be installed in Mac M1 because of error ERROR: numpy-1.18.5-cp38-cp38-macosx_11_0_arm64.whl is not a supported wheel on this platform. #48
Comments
I got the same issue. Not quite sure if we need to reinstall a lower version instead? |
I encountered the same problem when I installed it. How did you install TensorFlow? I finally downloaded https://github.com/apple/tensorflow_macos/releases and manually executed download_and_install. This method works for me. |
This didn't work for me :/ |
Did you guys use anaconda? |
I got the same issue.and I have tried the similar issue for X86 but it doesn't work |
Same issue for me on Mac Mini M1 With Big Sur Beta. @pekoWANG what did you exactly with the downloaded archive along with the download_and_install-script? |
Same issue with me. Tried MANY different methods. Also tried older versions of tensorflow, but that also didn't work because it was the "wrong type of architecture" (referring to the new processor). |
Yes, it is weird since Apple announced that tensor flow was optimised in MacBook Pro M1 https://blog.tensorflow.org/2020/11/accelerating-tensorflow-performance-on-mac.html We should contact Macbook Pro for a solution. |
hello guys I think I have found the solution. |
It's work for me |
So I installed Xcode and now don’t have any new python installed (only version 2.7.16, which is the version that comes with Big Sur.
Any tips for getting puython from Xcode?
… On 6 Dec 2020, at 11:34, roy ***@***.***> wrote:
hello guys I think I have found the solution.
first, uninstall anaconda and any python3 that you didn't download from apple.
then please xcode-select --install(maybe you can download Xcode from app store)
after that, you will get python3.8.2 from apple , please check if your python is 3.8.2 and it's path is/usr/bin/python3.
if succeed, run the install_venv.sh again.
ps:in the last step, you should build a new venv,or just delete the old venv on anaconda/python3 not downloaded from apple
and it works finally.
It's work for me
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#48 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AC64ESXCE7CYR3BUCTKUJATSTNT5BANCNFSM4UMRG5MA>.
|
I download Xcode app and run ''xcode-select --install''at the same time so I can't find out where the python3.8.2 came from.how about trying downloading the Xcode command line tools for Xcode12.2 (you can find it in readme)and then bash '' xcode-select --install'' in the terminal? |
I got Tensor Flow working on my Anaconda Spyder. As I was a noob to these, so let me share my detailed findings for other people in similar boat. First I downloaded: https://github.com/apple/tensorflow_macos/releases/download/v0.1alpha0/tensorflow_macos-0.1alpha0.tar.gz After unzipping, there is 2 folders inside arm64 and x86_64. The first reaction is for people to install arm64, since we have the Mac M1 chip. But actually since we wanted to install into Anaconda which runs through Rosetta2 as an Intel, we should install x86_64, which will run slower, but at least you have all the libraries such as pandas and support apps. To Install x86_64 into Anaconda (so I can run in Spyder):
Source: #7 (comment) ** To Install arm64 into virtualenv ** To install:
To Run:
To toggle between CPU and GPU runs adjust the device_name below: To make it faster, turn off the default Eager mode with the following line: Run Speed Comparison for MNIST character recognition: |
@godkaieethu Thanks a lot! I will try it :) |
I solved the "ERROR: numpy-1.18.5-cp38-cp38-macosx_11_0_arm64.whl is not a supported wheel on this platform" by uninstalling the python 3.8 first and then re-installing it through the Xcode Command Line Tools. After that I ran the install script again and had no issues. If you install python directly it will not work and you will get the above error. BTW I tested TF on M1 Mac Mini against TF on RTX 2080Ti and it ran 14% faster. I was so amazed that I posted it on Medium |
@tampapath what is the Xcode Command Line code for the install? |
Hi simonaque, Go back to https://github.com/apple/tensorflow_macos site. Under the REQUIREMENTS: "Python 3.8, available from the Xcode Command Line Tools" click on the Command Line Tools link. That will get you to apples developers site. Sign in with your password and you will be presented with download links. Choose the one corresponding to the version of XCode that you have. Python 3.8 is included in the download. I hope this helps. |
For anyone tuning in later, the latest Tensorflow install script seems to have a typo with some case mismatches in the variable names. I proposed a Pull Request to fix that & add Conda support (so you can install TF in your Miniforge Conda environment). I also provided instructions for how I installed both an ARM supported version of Miniforge/Conda Python and Tensorflow on it. Feel free to manually apply my changes and see how it goes for you: #63 |
@monikavila, as @tampapath suggested, you'll want to use python from Xcode. Once you install it, it should be at
|
none of the above worked for me. I tried uninstalling the versions of python on my system (not the native ones), uninstalling x-code command line tools and reinstalling, but I continued to get a different error ("illegal hardware instruction") however, I temporarily downgraded to tensorflow 1.5.0 (and used matching versions of keras, etc.) and the errors went away. if anyone figures out how to get rid of the illegal hardware instruction error, please reply! |
None of the above worked for me. The kernel continues to break down when I try to import Tensorflow. |
Same here, I managed to install it into anaconda venv, but kernel keeps breaking down when I try to import Tensorflow. |
You're using the word 'anaconda' -- remember that anaconda is not ARM compatible. You need to use the ARM version of miniforge (or some other ARMed version of Python). I personally used the ARM version of miniforge |
I've used conda mini-forge to install many packages for data work, to include numpy, pandas, matplotlib, jupyterlab3, seaborn, sqlalchemy, geopy, elementpath, google-cloud-bigquery, scikit-learn. This works so far but also brings python 3.9 along in my home directories. There's no need to uninstall anything. To create a venv I hunted down the version of python that installed from apple, 3.8.2. The tensorflow package won't install in a 3.9 venv. Version 3.8 should be installed in /Library/Developer/CommandLineTools/usr/bin/python3 Create a virtual environment with 3.8: Use this new environment when calling the install_venv.sh path_to_new_venv. I now have two virtual environments for data work on the M1 Macbook, but I think it's feasible to save data from one to use in the other. This is an alpha version, so I think it's worth a little trouble to use the new Macbook, which is a fast and portable platform. |
sadly, this still does not work for me. here are the exact steps I followed:
this crashes, and gives me EDIT: Found a solutionmy terminal was running with Rosetta :( I opened my terminal without rosetta, did the same exact steps outlined above, and everything worked. woo! |
Worked perfectly, thanks! |
same,i see some guy worked,they used miniconda,but i anaconda.is this? |
@tomuGo Anaconda is not the same thing as Miniforge, Anaconda has not been compiled for ARM yet. Consider following the steps and making the changes proposed in !63 if you want a Conda Python install, or following the instructions in this issue to follow the officially supported Apple method. |
Additional tutorial which could help to setup TF within M1 approaching by miniforge here. |
Hi, it worked perfectly after days struggling. However I am a noob, and when I try to run it in Spyder it says
But if I run: I have restarted the kernel but nothing will work. How could I solve this? |
Any reason you aren't using the psuedo-official instructions that the Apple TensorFlow Team (and I, as a volunteer) wrote in Issue 153? #153. Anaconda doesn't work on ARM64 -- it works in a compiled Rosetta x86 mode, but you will lose all the ARM optimizations then. |
My solution was to install all with coda mini forge. Another option is to install Visual Code and they released a version that could run with ARM. But my problem is that sometimes (almost always) the kernel dies. That is something I could not solve yet. |
Hi, so I have as well tried but I get the following error after I run step 3: |
@gabirelasanchezzz And you are sure you ran the 'Sanity Check' steps in the 'Install Miniforge' section and all of them looked right, pointing to miniforge? It really sounds like you did not install Miniforge correctly. |
@mwidjaja1 I have done all the steps, but I realized my after doing the sanity check I get: |
@gabirelasanchezzz I think you must have confused your Mac to what's going on because the guide doesn't tell you to install Anaconda and yet you have it. I dunno how much any of us can help you at this point to be honest -- this seems like a configuration issue for your Mac specifically now. My best advice is to find your .bashrc/.zshrc file (depending on what you store all your environment variables in), delete anything related to anaconda/miniforge, delete anaconda/miniforge from your computer completely, and start again. Short of that, there's not much I think we can help you with short of starting completely from fresh. |
@mwidjaja1 I see. I am new here so I think I just messed the configuration. Thanks for trying to help, really! |
@gabirelasanchezzz yeah sorry 😔. I just am out of ideas on how to help you remotely unfortunately. But yeah my best advice is do your darnest to start from fresh again in regards to your terminal environment and uninstalling everything but the system Python and starting from fresh. Or create a new user account on your Mac and try setting it up there, just so at least you have an 'answer key' you can compare your currrent user account with to see where you might have went wrong. Best of luck! |
@mwidjaja1 Oh I had not thought about the user. Thanks a lot! |
Do you remember what changes were made, I also encountered the same problem? |
Hi, I desisted. All I tried did not work. However, I have not tried yet the solution of @leoloman . I definitely need to try this. Best of luck |
I use bash instead of zsh, command success!I dont know why,but it works |
Has anyone successfully install object detection on python? Any hint? |
I followed the Clayton Pilat's instructions from here and got everything installed that I was struggling with for weeks:
Apple MacBook Pro M1 / Big Sur 11.2.3, Python 3.8.8 |
@monikavila I fixed it by downgrading my python from 3.9.1 to 3.8.6 |
Tried so many online tutorials to install, finally found a one worked ! |
Hi, sorry this does not work for me either. The next error pops up: ERROR: grpcio-1.33.2-cp38-cp38-macosx_10_16_x86_64.whl is not a supported wheel on this platform. |
@gabirelasanchezzz You're using an Intel wheel file but this thread is for M1 computers. |
@mwidjaja1 I do have an M1. I just was following the instructions @denalist provided. |
Ahh gotcha. Yeah I'm not sure how to help you then. The route @denalist took, while legitimate for sure, does not use a native M1 Python. It uses Rosetta to build an Intel version of Python, for M1. Upside, installation should be easier and the entire world of pip + conda is at your fingertips. Downside, you won't get any of the m1 Processor + GPU efficiencies, and then situations like these. My guess is your Mac is confused between using the M1 version of Python it came with vs. the intel version you tried to download. I did write my own tutorial for M1 Python + TensorFlow at #153 but I confess, it does get a little bit tricky because it is a strange scenario. In that path you would get the M1 optimizations but not every package will work, though most of the 'popular' packages like Numpy/Scipy would work. |
@gabirelasanchezzz Please read it before making the conclusion, I didnt provide the solution. and the thread is clear enough says "M1". |
@mwidjaja1 I just went to your tutorial and started following the steps. When I eventually reached: "file $(which python)" in the terminal, Mach-O 64-bit executable x86_64 appears, but I do have an M1, so as you said, my Mac is confused. Do you know any way to fix this?? |
Does |
it directs me to /opt/anaconda3/bin/python |
Please follow that section because it tells you the appropriate steps to redirect your Python to If you did all that, set your environment paths to Miniforge's Python Installation. To do that, you need to figure out where conda was installed to (it's probably ~/miniforge3/condabin/conda) and then run |
Hey guys, |
I am trying to install tensor flow in the new MacBook Pro M1 but it gives the error
ERROR: numpy-1.18.5-cp38-cp38-macosx_11_0_arm64.whl is not a supported wheel on this platform.
The text was updated successfully, but these errors were encountered: