Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TensorFlow installation results in ImportError: No module named tensorflow

I'm trying to get TensorFlow to work on my Mac (OSX El Capitan 10.11.2). I tried the pip install from the setup guide and also followed the instructions in the accepted answer here.

In both cases I am able to successfully activate the virtualenv and my prompt changes to tensorflow. Python works fine, I'm able to do simple computations on the command line. But when I try to import tensorflow:

import tensorflow as tf

I repeatedly get this error:

ImportError: No module named tensorflow

Any help would be appreciated.

like image 441
Eddy Avatar asked Jan 21 '16 08:01

Eddy


1 Answers

I had the issue reported in the original question. Python worked fine, I followed the installation steps on the Tensforflow website, and got "No module named tensorflow."

Re-installing python via brew, and re-installing pip as a result, fixed it. I didn't need to uninstall anything, just the line below along with the normal pip install from the tensorflow installation document afterwards:

brew install python
like image 170
Eric C. Bohn Avatar answered Sep 28 '22 05:09

Eric C. Bohn