1

All of the installation guides for installing tensorflow compatible with the Macbook Air M1 processor seem to be dependent on using virtual environments in order to configure it.

For example, two references are here: https://medium.com/gft-engineering/macbook-m1-tensorflow-on-jupyter-notebooks-6171e1f48060 and here: https://github.com/jeffheaton/t81_558_deep_learning/blob/master/install/tensorflow-install-mac-metal-jul-2021.ipynb

I would like to just have a universal installation of tensorflow. Meaning that I don't need to activate a virtual environment and all of that. My python version is configured in the following way:

user@air 6:33:44$ where python3
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3
/usr/local/bin/python3
/usr/bin/python3

user@air 6:33:46$ ls -la /Library/Frameworks/Python.framework/Versions/3.9/bin/python3
lrwxr-xr-x  1 root  admin  9 Sep 14 23:10 /Library/Frameworks/Python.framework/Versions/3.9/bin/python3 -> python3.9

user@air 6:33:56$ ls -la /usr/local/bin/python3
lrwxr-xr-x  1 root  wheel  69 Sep 14 23:10 /usr/local/bin/python3 -> ../../../Library/Frameworks/Python.framework/Versions/3.9/bin/python

user@air 6:38:09$ which python
python: aliased to python3

user@air 6:38:15$ which python3
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3

user@air 6:38:19$ python3 --version
Python 3.9.7

What do I have to do in order to have a clean installation that works with tensorflow and is independent of a virtual environment? Currently, if I try I have the following issue:

user@air 6:35:41$ pip list | grep tensorflow
tensorflow              2.6.0
tensorflow-estimator    2.6.0

user@air 6:35:52$ python
Python 3.9.7 (v3.9.7:1016ef3790, Aug 30 2021, 16:39:15)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
zsh: illegal hardware instruction  python3
Nimantha
  • 6,405
  • 6
  • 28
  • 69
jlarks32
  • 931
  • 8
  • 20
  • Hi! It is always safer to test the programs in a virtual environment to avoid conflict between libraries. Can you try the instructions in below thread once ? https://towardsdatascience.com/installing-tensorflow-on-the-m1-mac-410bb36b776 –  May 11 '22 at 13:10

0 Answers0