pip3 install tensorflow
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 tfBinaryURL depends on the operating system and Python version. Find the appropriate value for tfBinaryURL here. For example, if you are installing TensorFlow for macOS and Python 3.6 issue the following command:
$ sudo pip3 install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.9.0-py3-none-any.whl
Python 2.7 https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.9.0-py2-none-any.whl
Python 3.4, 3.5, or 3.6 https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.9.0-py3-none-any.whl
After installing TensorFlow, validate your installation to confirm that the installation worked properly.
Invoke python from your shell as follows:
$ python
Enter the following short program inside the python interactive shell:
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
If the system outputs the following, then you are ready to begin writing TensorFlow programs:
Hello, TensorFlow!
To uninstall TensorFlow, issue one of following commands: $ pip uninstall tensorflow $ pip3 uninstall tensorflow
Thank you so much!!! You saved my day!!