Set up Python Environment

Create and activate the conda virtual environment for TensorFlow:

conda create --name py364_tf python=3.6.4
source activate py364_tf

In this case, we use Python 3.6.4 as the base version of Python. The environment is located at: ~/anaconda3/envs/py364_tf

Install TensorFlow

The url of the latest version of TensorFlow package can be found at

For Mac:

pip install --ignore-installed --upgrade

For Ubuntu:

pip install --ignore-installed --upgrade
pip install --ignore-installed --upgrade


Verify the installation with the following Python code:

import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()

If TensorFlow is successfully installed, a message would be printed: “b’Hello, TensorFlow!’”.