Installing packages with Anaconda

Viewed 4954

On Ubuntu 14.04, I have installed Anaconda, which I use as my main Python interpreter. I now want to install the TensorFlow library and use this via Anaconda. So, I downloaded the relevant foo.whl file from the TensorFlow website, and then ran pip install foo.whl. After this, I ran pip freeze, and it showed me tensorflow==0.7.1 indicating that it was installed successfully.

However, using the Anaconda interpreter, when I run a Python file which has import tensorflow, it tells me ImportError: No module named 'tensorflow'. Additionally, if I search my Anaconda directory, there is no reference to TensorFlow.

Now at first, I thought this was because pip install was using pip that comes with the native Ubuntu installation. However, I have the line export PATH=/home/karnivaurus/Libraries/Anaconda/bin:$PATH in my .bashrc file, and so this suggests it would use Anaconda's pip.

Any idea what's going on? Thanks!

3 Answers

First uninstall all the dependencies of tensorflow using

pip uninstall tensorflow

Then install tensorflow package with conda run:

 conda install -c jjhelmus tensorflow=0.10.0rc0

If you want to install tensorflow package with pip run:

pip install -i https://pypi.anaconda.org/jjhelmus/simple tensorflow

Sources: https://anaconda.org/jjhelmus/tensorflow

Related