{"id":27442,"library":"tensorflow-macos","title":"TensorFlow macOS","description":"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.","status":"active","version":"2.16.2","language":"python","source_language":"en","source_url":"https://github.com/apple/tensorflow_macos","tags":["machine-learning","deep-learning","apple-silicon","macos","gpu"],"install":[{"cmd":"pip install tensorflow-macos==2.16.2","lang":"bash","label":"Install with pip"},{"cmd":"conda install -c apple tensorflow-deps\npip install tensorflow-macos==2.16.2","lang":"bash","label":"Install with conda env (Apple Silicon)"}],"dependencies":[{"reason":"Provides Metal GPU acceleration on Apple Silicon; required for GPU training.","package":"tensorflow-metal","optional":true},{"reason":"Core dependency for TensorFlow operations.","package":"numpy","optional":false}],"imports":[{"note":"Standard import, no separate module name.","symbol":"tensorflow","correct":"import tensorflow as tf"}],"quickstart":{"code":"import tensorflow as tf\nprint(\"TensorFlow version:\", tf.__version__)\nprint(\"GPU Available:\", tf.config.list_physical_devices('GPU'))\n# Quick matrix multiply to test MPS\nx = tf.random.normal((1000, 1000))\ny = tf.matmul(x, tf.transpose(x))\nprint(\"Matrix multiply result shape:\", y.shape)","lang":"python","description":"Verify installation and GPU availability on Apple Silicon."},"warnings":[{"fix":"Upgrade to TensorFlow 2.13+ and install via `pip install tensorflow`.","message":"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.","severity":"breaking","affected_versions":">=2.13.0"},{"fix":"Run `pip install tensorflow-metal` and then check `tf.config.list_physical_devices('GPU')`.","message":"GPU acceleration via Metal is not enabled by default. You must install `tensorflow-metal` plugin and verify GPU is detected.","severity":"gotcha","affected_versions":"all"},{"fix":"Migrate to TF2.x eager execution and tf.function decorators.","message":"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.","severity":"deprecated","affected_versions":">=2.16.0"},{"fix":"Install standard `tensorflow` for Intel Macs.","message":"The `tensorflow-macos` package on PyPI only works on Apple Silicon (ARM64) macOS. It will fail to install on Intel Macs or other OS.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Ensure Python >=3.9 and use `pip install --upgrade pip` then retry.","cause":"Only Python 3.9+ is supported; or pip index issues.","error":"ERROR: Could not find a version that satisfies the requirement tensorflow-macos==2.16.2"},{"fix":"Activate correct environment (conda/venv) and install tensorflow-macos.","cause":"Attempting to import without installing, or installed under a different Python environment.","error":"ModuleNotFoundError: No module named 'tensorflow'"},{"fix":"Uninstall and install the appropriate TensorFlow for your platform: `tensorflow` (GPU CUDA) or `tensorflow-cpu`.","cause":"Installed tensorflow-macos on a non-macOS system (e.g., Linux) that expects CUDA.","error":"ImportError: libcublas.so.11: cannot open shared object file: No such file or directory"},{"fix":"Install `tensorflow-metal` and restart Python kernel.","cause":"Missing tensorflow-metal plugin when using MPS on Apple Silicon.","error":"tensorflow.python.framework.errors_impl.NotFoundError: No registered 'MPS' OpKernel ..."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}