简体   繁体   中英

Install Tensorflow in MacOs M1

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM