TensorFlow macOS
raw JSON → 2.16.2 verified Fri May 01 auth: no python
Apple Silicon native build of TensorFlow 2.x for macOS. Current version 2.16.2, released Aug 2024. Provides GPU acceleration via Metal Performance Shaders (MPS) on Apple M1/M2/M3 hardware. Release cadence follows upstream TensorFlow roughly quarterly.
pip install tensorflow-macos==2.16.2 Common errors
error ERROR: Could not find a version that satisfies the requirement tensorflow-macos==2.16.2 ↓
cause Only Python 3.9+ is supported; or pip index issues.
fix
Ensure Python >=3.9 and use
pip install --upgrade pip then retry. error ModuleNotFoundError: No module named 'tensorflow' ↓
cause Attempting to import without installing, or installed under a different Python environment.
fix
Activate correct environment (conda/venv) and install tensorflow-macos.
error ImportError: libcublas.so.11: cannot open shared object file: No such file or directory ↓
cause Installed tensorflow-macos on a non-macOS system (e.g., Linux) that expects CUDA.
fix
Uninstall and install the appropriate TensorFlow for your platform:
tensorflow (GPU CUDA) or tensorflow-cpu. error tensorflow.python.framework.errors_impl.NotFoundError: No registered 'MPS' OpKernel ... ↓
cause Missing tensorflow-metal plugin when using MPS on Apple Silicon.
fix
Install
tensorflow-metal and restart Python kernel. Warnings
breaking tensorflow-macos was merged into the standard tensorflow package starting from TensorFlow 2.13. Use `pip install tensorflow` instead; installing `tensorflow-macos` may install an older version or break. ↓
fix Upgrade to TensorFlow 2.13+ and install via `pip install tensorflow`.
gotcha GPU acceleration via Metal is not enabled by default. You must install `tensorflow-metal` plugin and verify GPU is detected. ↓
fix Run `pip install tensorflow-metal` and then check `tf.config.list_physical_devices('GPU')`.
deprecated As of TensorFlow 2.16, the `tf.compat.v1` module is deprecated and may be removed in future versions. Code relying on TF1.x patterns will break. ↓
fix Migrate to TF2.x eager execution and tf.function decorators.
gotcha The `tensorflow-macos` package on PyPI only works on Apple Silicon (ARM64) macOS. It will fail to install on Intel Macs or other OS. ↓
fix Install standard `tensorflow` for Intel Macs.
Install
conda install -c apple tensorflow-deps
pip install tensorflow-macos==2.16.2 Imports
- tensorflow
import tensorflow as tf
Quickstart
import tensorflow as tf
print("TensorFlow version:", tf.__version__)
print("GPU Available:", tf.config.list_physical_devices('GPU'))
# Quick matrix multiply to test MPS
x = tf.random.normal((1000, 1000))
y = tf.matmul(x, tf.transpose(x))
print("Matrix multiply result shape:", y.shape)