Install Tensorflow in MacOs M1

Question:

I am struggling to install tensorflow on MacOS Monterey 12.5.1 with M1 Chip

pip3 install tensorflow-macos

pip3 install tensorflow-metal

I keep getting this error: ERROR: Could not find a version that satisfies the requirement python (from versions: none)

I tried venv, I tried miniconda, anaconda, still same issue.

How can I install tensorflow in M1 MacOS ?

Asked By: SimbaNinja

||

Answers:

You can follow installation instructions from the apple developer website.
With conda first, you need to install tensorflow-deps with:

conda install -c apple tensorflow-deps

then

python -m pip install tensorflow-macOS
python -m pip install tensorflow-metal

This is the procedure recommended by apple, so if you haven’t installed "tensorflow-deps", first try that.
Also this is suggested for your problem in the same webpage:

Error: “Could not find a version that satisfies the requirement
tensorflow-macos (from versions: none).” A TensorFlow installation
wheel that matches the current Python environment couldn’t be found by
the package manager. Check that the Python version used in the
environment is supported (Python 3.8, Python 3.9, Python 3.10).

So try using the mentioned Python versions.
Also, here is the long thread of people facing different issues with TensorFlow on mac, which helped me a lot.

Answered By: Morteza
brew install [email protected]
/opt/homebrew/Cellar/[email protected]/3.8.16/bin/python3.8  -m venv ~/TF
source ~/TF/bin/activate
pip install --upgrade pip
pip install tensorflow-macos
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.