Cannot import TensorFlow on Mac M1

I'm trying to run a shell script on Mac OS M1, but it keeps giving me the error:

ModuleNotFoundError: No module named 'tensorflow'

I followed the instructions from here: https://caffeinedev.medium.com/how-to-install-tensorflow-on-m1-mac-8e9b91d93706.

Although I now can import it manually in python:

(mlp) sarah@Air-Sarah AIR % python 
Python 3.8.11 (default, Aug 16 2021, 12:04:33) 
[Clang 12.0.0 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> tf.__version__
'2.8.0'

my error in shell remains the same.

I also tried to install it with https://github.com/apple/tensorflow_macos. Nothing changed.

How can I address this issue?

Answered by Dinara in 708287022

I've been able to resolve it following this guide

Accepted Answer

I've been able to resolve it following this guide

Please if you found an answer share it here

Cannot import TensorFlow on Mac M1
 
 
Q