python - No module named tensorflow in jupyter -
i have imports in jupyter notebook , among them tensorflow:
importerror traceback (most recent call last) <ipython-input-2-482704985f85> in <module>() 4 import numpy np 5 import six.moves.copyreg copyreg ----> 6 import tensorflow tf 7 six.moves import cpickle pickle 8 six.moves import range importerror: no module named tensorflow
i have on computer, in special enviroment , connected stuff also:
requirement satisfied (use --upgrade upgrade): tensorflow in /users/mac/anaconda/envs/tensorflow/lib/python2.7/site-packages requirement satisfied (use --upgrade upgrade): six>=1.10.0 in /users/mac/anaconda/envs/tensorflow/lib/python2.7/site-packages (from tensorflow) requirement satisfied (use --upgrade upgrade): protobuf==3.0.0b2 in /users/mac/anaconda/envs/tensorflow/lib/python2.7/site-packages (from tensorflow) requirement satisfied (use --upgrade upgrade): numpy>=1.10.1 in /users/mac/anaconda/envs/tensorflow/lib/python2.7/site-packages (from tensorflow) requirement satisfied (use --upgrade upgrade): wheel in /users/mac/anaconda/envs/tensorflow/lib/python2.7/site-packages (from tensorflow) requirement satisfied (use --upgrade upgrade): setuptools in ./setuptools-23.0.0-py2.7.egg (from protobuf==3.0.0b2->tensorflow)
i can import tensorflow on computer:
>>> import tensorflow tf >>>
so i'm confused why situation in notebook?
i had same problem, , solved looking @ output of:
jupyter kernelspec list
which outputs kernel information:
python2 /users/username/library/jupyter/kernels/python2 python3 /users/username/library/jupyter/kernels/python3
notice path points jupyter kernel user. use within the anaconda environment, needs point conda env using, , anaconda3\envs\env_name\share\jupyter\kernels\python3
.
so, remove jupyter kernelspec, use:
jupyter kernelspec remove python3
or jupyter kernelspec remove python2
if you're using python 2
now, output of jupyter kernelspec list
should point correct kernel.
see https://github.com/jupyter/notebook/issues/397 more information this.
Comments
Post a Comment