Attempts to install Tensorflow on Mac Studio M1 fail

I am attempting to install Tensorflow on my M1 and I seem to be unable to find the correct matching versions of jax, jaxlib and numpy to make it all work.

I am in Bash, because the default shell gave me issues.

I downgraded to python 3.10, because with 3.13, I could not do anything right.

Current actions:

bash-3.2$ python3.10 -m venv ~/venv-metal
bash-3.2$ python --version
Python 3.10.16

python3.10 -m venv ~/venv-metal
source ~/venv-metal/bin/activate
python -m pip install -U pip

python -m pip install tensorflow-macos

And here, I keep running tnto errors like: (venv-metal):~$ pip install tensorflow-macos tensorflow-metal

ERROR: Could not find a version that satisfies the requirement tensorflow-macos (from versions: none)
ERROR: No matching distribution found for tensorflow-macos

What is wrong here? How can I fix that?

It seems like the system wants to use the x86 version of python ... which can't be right.

There is one way I seem to have gotten this to work ...

brew install python@3.9
python3.9 -m venv venv-metal-39
source venv-metal-39/bin/activate
pip install tensorflow-macos==2.12.0 tensorflow-metal==0.7.0
python -c "import tensorflow as tf; print(tf.__version__)"

But why does macOS insist on using the x86 version of python? And Why can I not use python 3.13 for this ... and install an old version like 3.9? (also 3.10 fails) ... and an old version of tensorflow.

You're right, those python libs tensorflow-* are not marked as compatible with newer pythons.

That python3.9 is not necessarily x86 though - you can check it:

python3.9
import platform
platform.machine()

Thanks @emmtee! But I think the speed benefits of running native on M1 (in stead of slightly older versions on Rosetta) outweighs the desire to use the latest ...

Attempts to install Tensorflow on Mac Studio M1 fail
 
 
Q