No module named tensor flow -- iPython notebook

18,823

Solution 1

You should deactivate and re-activate the environment

source deactivate tensorflow
source activate tensorflow

Solution 2

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

Further, on terminal activate tensorflow

>>> source activate tensorflow

before open iPython Notebook

>>> ipython notebook

At last, I have to restart my macbook to make it work....

Solution 3

i have missed tensorflow install (3) number below the list.. now i have solved

  1. for anaconda install

  2. for enviroment install https://github.com/tensorflow/tensorflow/blob/master/tensorflow/g3doc/get_started/os_setup.md#anaconda-installation

  3. for tensorflow install https://github.com/conda-forge/tensorflow-feedstock

Share:
18,823
Ancalagon BerenLuthien
Author by

Ancalagon BerenLuthien

Updated on June 04, 2022

Comments

  • Ancalagon BerenLuthien
    Ancalagon BerenLuthien almost 2 years

    I understand this may be an old question, but still I cannot find solution from off-the-shelf Q$A. Here is the problem:

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

    Assignment2 requires tensorflow. BTW, I already installed Anaconda, already made tensorflow working on Pycharm on the same computer which is Macbook, but do not know how to make it work on iPythonNotebook environment.

    The codes are quite simple, as follows:

    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 run Pycharm+tensorflow well.