18 Steps to install tensorflow_macos on the M1 MacBook (2020)

If your installation process of tensorflow_macos has been like mine, first off, I’m sorry. Second off, there is some great news! I have put together steps that led to my successful installation below. I need to credit a GitHub thread where some of the steps below come from here.

Also, if you haven’t already, I have made a YouTube video that details this install process here.

1. Install miniforge3: https://github.com/conda-forge/miniforge/#download. Use the Apple Silicon link.

2. Restart terminal and check that Conda is recognized:


3. Create Conda environment with python3.8 since python3.9 is the default from Miniforge (user python38 for your name):

conda create —name python38-demo-v2 python=3.8

4. Activate virtual environment:

conda activate python38-demo-v2

5. Download the zipped tensorflow_macos tar file from apple

6. Navigate to Downloads and unzip the tar file:

tar -xvf <filename>

7. Navigate to the working directory of arm64 within the newly unzipped tensorflow_macos file

8. Get current working directory


9. Set variables to the output of pwd in previous step:


10. Set env variable to be the location of your python virtual environment:

env="/Users/nick/miniforge3/envs/<env_name>" # location of your python virtual environment

11. Install dependencies:

conda install cached-property
conda install six

12. Install additional dependencies with pip:

pip install –upgrade -t "$env/lib/python3.8/site-packages/" –no-dependencies –force "$libs/grpcio- 1.33.2-cp38-cp38-macosx_11_0_arm64.whl"
pip install –upgrade -t "$env/lib/python3.8/site-packages/" –no-dependencies –force "$libs/h5py- 2.10.0-cp38-cp38-macosx_11_0_arm64.whl"
pip install –upgrade -t "$env/lib/python3.8/site-packages/" –no-dependencies –force "$libs/tensorflow_addons-0.11.2+mlcompute-cp38-cp38-macosx_11_0_arm64.whl"

13. Additional dependencies to be installed with conda:

conda install -c conda-forge -y absl-py
conda install -c conda-forge -y astunparse
conda install -c conda-forge -y gast
conda install -c conda-forge -y opt_einsum conda install -c conda-forge -y termcolor
conda install -c conda-forge -y typing_extensions conda install -c conda-forge -y wheel
conda install -c conda-forge -y typeguard

14. Install dependencies with pip:

pip install wrapt flatbuffers tensorflow_estimator google_pasta keras_preprocessing protobuf
pip install –upgrade -t "$env/lib/python3.8/site-packages/" –no-dependencies –force "$libs/tensorflow_macos-0.1a1-cp38-cp38-macosx_11_0_arm64.whl"
pip install tensorboard

15. Type python into the command prompt to open a python shell


16. Import tensorflow on command line. Make sure this is pointing to the right version within your downloads folder

import tensorflow

If you completed the last step successfully with no errors, you are all set! Happy Deep Learning 🙂

Read More From AI Buzz