Install TensorFlow on macOS
Install TensorFlow:
Assuming the prerequisite software is installed on your Mac, take the following steps:
- Install TensorFlow by invoking one of the following commands:
$ pip install tensorflow # Python 2.7; CPU support $ pip3 install tensorflow # Python 3.n; CPU support
If the preceding command runs to completion, you should now validate your installation.
- (Optional.) If Step 1 failed, install the latest version of TensorFlow by issuing a command of the following format:
$ sudo pip install --upgrade tfBinaryURL # Python 2.7 $ sudo pip3 install --upgrade tfBinaryURL # Python 3.n
where tfBinaryURL identifies the URL of the TensorFlow Python package. The appropriate value of tfBinaryURLdepends on the operating system and Python version.
- For example, if you are installing TensorFlow for macOS and Python 2.7 issue the following command:
$ sudo pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.10.1-py2-none-any.whl
If the preceding command fails, see installation problems.
Python 3.4, 3.5, or 3.6:
$ sudo pip3 install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.10.1-py3-none-any.whl