0

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?

user18101
  • 626
  • 3
  • 13
  • 22
  • Do you have a program called `pip2.7` that you can run to install the package? – mrry Feb 27 '17 at 02:11
  • There is a pip in my 2.7 dist-packages – user18101 Feb 27 '17 at 02:34
  • 1
    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](http://stackoverflow.com/a/26267333/3574081) for more suggestions. – mrry Feb 27 '17 at 02:50
  • It is no longer looking at the 3.5 dist-packages but still doesn't work – user18101 Feb 27 '17 at 22:57
  • 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 Mar 07 '17 at 21:57

1 Answers1

1

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
Jai
  • 3,211
  • 2
  • 17
  • 26