Skip to content

Instantly share code, notes, and snippets.

@brianspiering
Last active April 14, 2022 17:15
Show Gist options
  • Save brianspiering/dde45a6d99ef8782fff6f3239ebe73a9 to your computer and use it in GitHub Desktop.
Save brianspiering/dde45a6d99ef8782fff6f3239ebe73a9 to your computer and use it in GitHub Desktop.
Installing TensorFlow/Keras on Apple's M1

Instructions

  1. Download the wheel called tensorflow-2.4.1-py3-none-any.whl located at this public google drive link:
    drive.google.com/drive/folders/1oSipZLnoeQB0Awz8U68KYeCPsULy_dQ7

  2. Assuming you downloaded the wheel to your Downloads folder, install it with pip:
    $ pip install ~/Downloads/tensorflow-2.4.1-py3-none-any.whl --user

  3. Test that it works with ipython at the command line:

$ ipython --no-banner
In [1]: import tensorflow

In [2]:

Troubleshooting Help

You can try Apple's directions here. They did not work for me.

If you having difficulties, you might be more succesful if you run iTerm2 or Terminal app in Rosetta mode. Rosetta mode enables a Mac with Apple silicon to use apps built for a Mac with an Intel processor.

  1. Duplicate iTerm2 or Terminal app.
  2. Rename the copy something like "iTerm2 Rosetta".
  3. Right click & "Get Info", check "Open in Rosetta".
  4. Now you have terminal that acts like an Intel Mac.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment