Installing Tensorflow in Python 3.5 with Anaconda

Posted on Fri 29 January 2016 in Notes

Since the release of Tensorflow 0.6, support for Python 3.3+ has finally been added.

However, if you are trying to install Tensorflow into an Anaconda install with conda you might just be using this command that is floating around the web:

# Old tensorflow version
$ conda install -c tensorflow

However, this is a packaged version of Tensorflow 0.5, and won't run on Python 3.3+

Instead you can install via pip into your Anaconda installation. Activate the environment you want to install into, or just install into root, and then use the following commands:

$ sudo easy_install --upgrade six
$ sudo pip install --upgrade

In the official documentation [1] they link to ...tensorflow-0.5.0-py2-none-any.whl, which is an older version of tensorflow for python 2.x. At the time of writing the newest version is 0.7, so I just manually updated the numbers in the URL to fetch and install the version I want.

On OSX El Capitan, with Anaconda 2.5 the above does throw an exception, but the exception happens late enough in the install script that tensoflow will be installed once done. I suppose this is part of working with pre-1.0 release software.

Before installing tensorflow, consider updating your anaconda installation, by running

$ conda update anaconda