0
votes

I am trying to install tensorflow for python 2.7 on Ubuntu 16. I am using pip install tensorflow-gpu and I get the following message in the terminal:

pip install tensorflow-gpu

Requirement already satisfied: tensorflow-gpu in /usr/local/lib/python3.5/dist-packages Requirement already satisfied: wheel>=0.26 in /usr/lib/python3/dist-packages (from tensorflow-gpu) Requirement already satisfied: six>=1.10.0 in /usr/lib/python3/dist-packages (from tensorflow-gpu) Requirement already satisfied: numpy>=1.11.0 in /usr/local/lib/python3.5/dist-packages (from tensorflow-gpu) Requirement already satisfied: protobuf>=3.1.0 in /usr/local/lib/python3.5/dist-packages (from tensorflow-gpu) Requirement already satisfied: setuptools in /usr/local/lib/python3.5/dist-packages (from protobuf>=3.1.0->tensorflow-gpu)

When I ftry to import tensorflow It says ImportError: No module named tensorflow I am guessing since it is looking in the python 2.7 packages.

Shouldn't it be looking in python 2.7 dist-packges?

1
Do you have a program called pip2.7 that you can run to install the package?mrry
There is a pip in my 2.7 dist-packagesuser18101
You might need to use a different command to install PIP packages for Python 2.7 (e.g. pip2.7 install tensorflow-gpu). See this answer for more suggestions.mrry
It is no longer looking at the 3.5 dist-packages but still doesn't workuser18101
Did you try installing in a virtualenv? The tensorflow website has instructions for that, and that will be much easier to get working than messing with your system's python and pip.Alexandre Passos

1 Answers

1
votes

I would suggest you to use anaconda and run the following command

conda install -c anaconda tensorflow-gpu

  • Anaconda will make your life easier... hope this helps This will also install the cuda toolkit and cudnn for you and you are good to go