9951 explained code solutions for 126 technologies


python-tensorflowHow can I install and use Python TensorFlow on an Apple M1 Mac?


To install and use Python TensorFlow on an Apple M1 Mac, you need to use the Apple Silicon version of TensorFlow.

  1. Download the latest version of Python 3.8.5.
  2. Install the version of Python 3.8.5 using the downloaded installer.
  3. Install the TensorFlow package with the command pip3 install tensorflow==2.4.0-rc1
  4. Verify that TensorFlow is installed correctly by running the following code:
import tensorflow as tf
print(tf.version)

Output example

2.4.0-rc1
  1. Check the TensorFlow documentation for more information on how to use TensorFlow.
  2. Follow the Apple Silicon-specific instructions for using TensorFlow on an M1 Mac.
  3. Test out your TensorFlow code on your Apple M1 Mac.

Edit this code on GitHub