Get the current version of the installed TensorFlow

Import the TensorFlow module, and then print out tf.__version__

import tensorflow as tf

or you can just have two ways like below to type in the terminal.

$ python -c 'import tensorflow as tf; print(tf.__version__)'

// or

$ pip list | grep tensorflow
tensorflow (0.7.1)

Update the TensorFlow

If you are upgrading from a previous installation of TensorFlow < 0.7.1, you should uninstall the previous TensorFlow and protobuf using pip uninstall first to make sure you get a clean installation of the updated protobuf dependency.

Uninstall the TensorFlow on your system, and check out Download and Setup to reinstall again.

If you are using pip install, go check the available version over, search keywords with mac/cpu/tensorflow to see the availabilities.

Then, set the path for download and execute in sudo.

$ export TF_BINARY_URL=

$ sudo pip install --upgrade $TF_BINARY_URL

Update the TensorFlow over Google Datalab?

Update the docker image built by Datalab

List all the docker:

$ docker ps -a
CONTAINER ID        IMAGE                                         COMMAND                  CREATED             STATUS                   PORTS                      NAMES
4e8c6ecdbe98            "/datalab/"        2 weeks ago         Up 21 minutes  >8080/tcp   datalab

As we have pulled the docker image built by Datalab team, there could be an update for the docker image.

Paster this path into your browser, the browser will lead you to

Then you see a lot of versions of docker image over their Container Registry.


Try to pull the version of local-20170218, and create a new docker to launch the image.

$ docker ps -a
CONTAINER ID        IMAGE                                         COMMAND                  CREATED             STATUS                   PORTS                      NAMES
d072d60618c8   "/datalab/"        21 hours ago        Up 21 hours    >8080/tcp   dalatab-20170218
4e8c6ecdbe98            "/datalab/"        2 weeks ago         Up 21 minutes  >8080/tcp   datalab

Open the notebook over the browser, then try to print out the version of TensorFlow. You will found the version get to upgrade!

Use %%bash to update directly

The post over stackoverflow said:

If you want to temporarily install a newer version into your existing environment for testing purposes (although this isn’t recommended) , then you could try installing tensorflow with the no dependencies option (--no-deps) in order to reduce the chance of breaking the working datalab environment.

wget && pip install --ignore-installed --no-deps tensorflow-0.8.0-cp27-none-linux_x86_64.whl

Go the check over, you see a lot of versions by filtering with the keyword linux/cpu/tensorflow-0.12.0-. However, I am not aware of the difference between cp27-none-linux_x86_64.whl, cp34-cp34m-linux_x86_64.whl, 0-cp35-cp35m-linux_x86_64.whl, and so on.

Just try to run with:

wget && pip install --ignore-installed --no-deps tensorflow-0.12.0-cp27-none-linux_x86_64.whl

After running the above command, you should see tensorflow is at version 0.12.0.