No module with tensor flow - iPython notebook

I understand that this may be an old question, but still I can not find a solution from the finished Q $ A. Here is the problem:

I follow Udacity "Machine Learning" and its assignments, and you need to use iPythonNotebook and tensorflow . Details: https://github.com/Omarito2412/udacity-deeplearning

Assignment2 requires a tensor flow. BTW, I already installed Anaconda , already made tensorflow running on Pycharm on the same computer, which is a Macbook , but does not know how to make it work in the iPythonNotebook environment.

The codes are pretty simple:

import numpy as np import tensorflow as tf from six.moves import cPickle as pickle from six.moves import range 

and the error message is as follows:

 ImportError Traceback (most recent call last) <ipython-input-1-0970743dd90d> in <module>() 2 # before proceeding further. 3 import numpy as np ----> 4 import tensorflow as tf 5 from six.moves import cPickle as pickle 6 from six.moves import range ImportError: No module named tensorflow 

Thanks. Any suggestions?

PS: I have this problem on two MacBooks, and both MacBooks work well with the Pycharm + tensor.

+2
source share
5 answers

After I tried installing Anaconda (I used other installation methods, which are shown in the link below) https://github.com/tensorflow/tensorflow/blob/master/tensorflow/g3doc/get_started/os_setup.md#anaconda- installation It worked ...

In addition, a tensor flow is activated on the terminal

 >>> source activate tensorflow 

before you open iPython Notebook

 >>> ipython notebook 

Finally, I have to restart my macbook for it to work.

+3
source

You must deactivate and reactivate the environment.

 source deactivate tensorflow source activate tensorflow 
+3
source

I skipped the tensorflow install (3) installation under the list. now i decided

+1
source

This is probably due to an anemic environment variable, one of the library path classes. I don’t know how iPythonNotebook designates the libraries in which it will search for files (for example, $ LD_LIBRARY_PATH), but I believe that you need to find it (list of library paths) and add the TensorFlow root directory.

0
source

It is more than likely that Tensorflow is not installed in the correct Python environment in Conda or not installed at all. Follow these steps:

 $ conda create -n tensorflow python=3.5 

Once this is done, you need to activate it, as shown below:

 $ source activate tensorflow 

Then, when you open IPython Notebook or Spyder, it recognizes Tensorflow.

0
source

All Articles