Skip to content
This repository has been archived by the owner on Jun 9, 2021. It is now read-only.

Numpy error at the end of installation #53

Open
icenando opened this issue Dec 5, 2020 · 25 comments
Open

Numpy error at the end of installation #53

icenando opened this issue Dec 5, 2020 · 25 comments

Comments

@icenando
Copy link

icenando commented Dec 5, 2020

Hi,
I just followed the steps here and in this video: https://www.youtube.com/watch?v=6W8pjnW65Q8&feature=youtu.be .
I'm still unable to install tensorflow on my m1 mac. Please see error message below:

Installing bundled binary dependencies.
ERROR: numpy-1.18.5-cp38-cp38-macosx_11_0_arm64.whl is not a supported wheel on this platform.

I've been trying to install tf for about 2 weeks now. I tried creating virtual environments through conda, venv and anaconda navigator. I tried putting together the various instructions given by contributors here, but still no success.
Please can someone help?

@SuperBruceJia
Copy link

Please refer to this issue:

#46

Have a wonderful day!

@ghost
Copy link

ghost commented Dec 5, 2020

I totally uninstalled the conda and other environment then create environment and install tensorflow_macos . it works

@godkaieethu
Copy link

I totally uninstalled the conda and other environment then create environment and install tensorflow_macos . it works

I uninstalled the Conda and downloaded python3.8.6 from python.org and then install TensorFlow_macos,but still breaked by 'ERROR: numpy-1.18.5-cp38-cp38-macosx_11_0_arm64.whl is not a supported wheel on this platform.'

@godkaieethu
Copy link

Hi,
I just followed the steps here and in this video: https://www.youtube.com/watch?v=6W8pjnW65Q8&feature=youtu.be .
I'm still unable to install tensorflow on my m1 mac. Please see error message below:

Installing bundled binary dependencies.
ERROR: numpy-1.18.5-cp38-cp38-macosx_11_0_arm64.whl is not a supported wheel on this platform.

I've been trying to install tf for about 2 weeks now. I tried creating virtual environments through conda, venv and anaconda navigator. I tried putting together the various instructions given by contributors here, but still no success.
Please can someone help?

I am confused why other guys can succeed in MacBook m1.does my MacBook m1 have any difference with other's?

@icenando
Copy link
Author

icenando commented Dec 5, 2020

I totally uninstalled the conda and other environment then create environment and install tensorflow_macos . it works

Please can you explain how you went about doing that? I thought I had too, but still the same problem, so maybe I did something wrong.

@juch0620
Copy link

juch0620 commented Dec 6, 2020

I got same numpy error on M1 macbook pro when anaconda is installed in the first place.

Don't use anaconda (or similar) if it's not native code for M1, instead use Apple's native binary. I was able to install tensorflow for M1 without error after remove anaconda. basically, use python3 from Xcode-select.

$ xcode-select --install

@SuperBruceJia
Copy link

Hi guys, here is the final solution:

  1. Download the archive file manually from here (https://github.com/apple/tensorflow_macos/releases/download/v0.1alpha0/tensorflow_macos-0.1alpha0.tar.gz).

  2. Unpack it and rename all files inside x86_64/ folder if your are using an Intel-based CPU. They all contain _11_0. Rename it to _10_16.

  3. Open install_venv.sh and rename those filenames (rename macosx_11_0 to macosx_10_16):

arch_list_x86_64=( numpy-1.18.5-cp38-cp38-macosx_10_16_x86_64.whl grpcio-1.33.2-cp38-cp38-macosx_10_16_x86_64.whl h5py-2.10.0-cp38-cp38-macosx_10_16_x86_64.whl scipy-1.5.4-cp38-cp38-macosx_10_16_x86_64.whl tensorflow_addons-0.11.2+mlcompute-cp38-cp38-macosx_10_16_x86_64.whl )
  1. Scroll down and rename all macosx_11_0 to macosx_10_16

  2. Rename tensorflow_macos*-cp38-cp38-macosx_11_0_$arch.whl to tensorflow_macos*-cp38-cp38-macosx_10_16_$arch.whl.

"$python_bin" -m pip install --upgrade --force -t "$VIRTUAL_ENV/lib/python3.8/site-packages/" --no-dependencies "$package_dir"/tensorflow_macos*-cp38-cp38-macosx_10_16_$arch.whl
  1. Open terminal, go inside your tensorflow_macos folder and run
./install_venv.sh /Users/<your user>/tensorflow_macos_venv/

e.g., for me, it's ./install_venv.sh /Users/shuyuej/tensorflow_macos_venv/

  1. Use this script to activate environment
  . "/Users/<your user>/tensorflow_macos_venv/bin/activate"

e.g., for me, it's . "/Users/shuyuej/tensorflow_macos_venv/bin/activate"

Have fun!

@nuwansam
Copy link

nuwansam commented Dec 6, 2020

Is there a solution for M1 based macs.

@SuperBruceJia
Copy link

SuperBruceJia commented Dec 6, 2020

Is there a solution for M1 based macs.

Dude, I'm not sure yet since I don't keep a M1-chip-based machine, but u can definitely try it out to see whether it works or not.

P.S. I think it should work on M1-based mac. BTW, if u are installing it, be sure to modify arch_list_arm64 rather than arch_list_x86_64.

Good luck!

@LRSnowX
Copy link

LRSnowX commented Dec 6, 2020

It's not working on my M1 MacBook Pro.

Installing bundled binary dependencies.
ERROR: numpy-1.18.5-cp38-cp38-macosx_10_16_arm64.whl is not a supported wheel on this platform.

Hi guys, here is the final solution:

  1. Download the archive file manually from here (https://github.com/apple/tensorflow_macos/releases/download/v0.1alpha0/tensorflow_macos-0.1alpha0.tar.gz).
  2. Unpack it and rename all files inside x86_64/ folder if your are using an Intel-based CPU. They all contain _11_0. Rename it to _10_16.
  3. Open install_venv.sh and rename those filenames (rename macosx_11_0 to macosx_10_16):
arch_list_x86_64=( numpy-1.18.5-cp38-cp38-macosx_10_16_x86_64.whl grpcio-1.33.2-cp38-cp38-macosx_10_16_x86_64.whl h5py-2.10.0-cp38-cp38-macosx_10_16_x86_64.whl scipy-1.5.4-cp38-cp38-macosx_10_16_x86_64.whl tensorflow_addons-0.11.2+mlcompute-cp38-cp38-macosx_10_16_x86_64.whl )
  1. Scroll down and rename all macosx_11_0 to macosx_10_16
  2. Rename tensorflow_macos*-cp38-cp38-macosx_11_0_$arch.whl to tensorflow_macos*-cp38-cp38-macosx_10_16_$arch.whl.
"$python_bin" -m pip install --upgrade --force -t "$VIRTUAL_ENV/lib/python3.8/site-packages/" --no-dependencies "$package_dir"/tensorflow_macos*-cp38-cp38-macosx_10_16_$arch.whl
  1. Open terminal, go inside your tensorflow_macos folder and run
./install_venv.sh /Users/<your user>/tensorflow_macos_venv/

e.g., for me, it's ./install_venv.sh /Users/shuyuej/tensorflow_macos_venv/

  1. Use this script to activate environment
  . "/Users/<your user>/tensorflow_macos_venv/bin/activate"

e.g., for me, it's . "/Users/shuyuej/tensorflow_macos_venv/bin/activate"

Have fun!

@godkaieethu
Copy link

godkaieethu commented Dec 6, 2020

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 from apple, please check if your python version is 3.8.2 and it's path is/usr/bin/python3.
if succeed, run the install_venv.sh again.
ps:in 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.

@roy-ren
Copy link

roy-ren commented Dec 6, 2020

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 from apple, please check if your python version is 3.8.2 and it's path is/usr/bin/python3.
if succeed, run the install_venv.sh again.
ps:in 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.

Works for me.

@acere
Copy link

acere commented Dec 6, 2020

I managed to install using the installation script without changing or removing any of my existing python installation by indicating explicitly the system python3.8 binary with the --python flag.

The command I used is

~$ /bin/bash ./install_venv.sh tf_mac --python=/usr/bin/python3

@icenando
Copy link
Author

icenando commented Dec 6, 2020

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 from apple, please check if your python version is 3.8.2 and it's path is/usr/bin/python3.
if succeed, run the install_venv.sh again.
ps:in 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.

This works for me too! Now I'm having problems importing pandas and matplotlib though...

@LRSnowX
Copy link

LRSnowX commented Dec 6, 2020

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 from apple, please check if your python version is 3.8.2 and it's path is/usr/bin/python3.
if succeed, run the install_venv.sh again.
ps:in 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.

this works for me too! thank you so much

@monikavila
Copy link

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 from apple, please check if your python version is 3.8.2 and it's path is/usr/bin/python3.
if succeed, run the install_venv.sh again.
ps:in 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.

@godkaieethu I downloaded Xcode but I have python 2.7. How can I update it?

@godkaieethu
Copy link

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 from apple, please check if your python version is 3.8.2 and it's path is/usr/bin/python3.
if succeed, run the install_venv.sh again.
ps:in 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.

@godkaieethu I downloaded Xcode but I have python 2.7. How can I update it?

try running "$ xcode-select --install " in terminal.

@monikavila
Copy link

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 from apple, please check if your python version is 3.8.2 and it's path is/usr/bin/python3.
if succeed, run the install_venv.sh again.
ps:in 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.

@godkaieethu I downloaded Xcode but I have python 2.7. How can I update it?

try running "$ xcode-select --install " in terminal.

@godkaieethu it does not work

@godkaieethu
Copy link

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 from apple, please check if your python version is 3.8.2 and it's path is/usr/bin/python3.
if succeed, run the install_venv.sh again.
ps:in 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.

@godkaieethu I downloaded Xcode but I have python 2.7. How can I update it?

try running "$ xcode-select --install " in terminal.

@godkaieethu it does not work

maybe you can follow Mr icenando's whole steps about this xcode solution in issue #46
he follow my steps but give more details.
hope it can work,good luck!

@monikavila
Copy link

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 from apple, please check if your python version is 3.8.2 and it's path is/usr/bin/python3.
if succeed, run the install_venv.sh again.
ps:in 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.

@godkaieethu I downloaded Xcode but I have python 2.7. How can I update it?

try running "$ xcode-select --install " in terminal.

Finally, it worked! I had to uninstall python and then get command line tools from apple developer.
Thanks so much for your help!

@monikavila
Copy link

Hello, I managed to install but when I want to import keras and matplotlib I have errors. Do you have any problem with that?

@icenando
Copy link
Author

icenando commented Dec 9, 2020

Hello, I managed to install but when I want to import keras and matplotlib I have errors. Do you have any problem with that?

@monikavila I managed to import Keras. I activated my venv and typed: python3 -m pip install keras . There were no error messages and I can import it in Jupyter Labs without any issues. Haven't actually fitted a model yet to test though.

Pandas and Matplotlib don't seem to work...

@mwidjaja1
Copy link

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 ran it.

Feel free to manually apply my changes and see how it goes for you: #63

@MarkusBansky
Copy link

Does anybody know whether the source code of this optimised tensorflow package is going to be publicly available?

@SaschaHeyer
Copy link

Can confirm the same behavior without conda #121

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests