tensorflow: Cannot import tensorflow in python

My env is like this:

python 2.7.10 I successfully installed tensorflow, using pip install https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl

then I goes into python, then import tensorflow as tf, I got this error:

>>> import tensorflow as tf
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Or\AppData\Local\Enthought\Canopy\User\lib\site-packages\tensorflow\__init__.py", line 4, in <module>
    from tensorflow.python import *
  File "C:\Users\Or\AppData\Local\Enthought\Canopy\User\lib\site-packages\tensorflow\python\__init__.py", line 22, in <module>
    from tensorflow.python.client.client_lib import *
  File "C:\Users\Or\AppData\Local\Enthought\Canopy\User\lib\site-packages\tensorflow\python\client\client_lib.py", line 35, in <module>
    from tensorflow.python.client.session import InteractiveSession
  File "C:\Users\Or\AppData\Local\Enthought\Canopy\User\lib\site-packages\tensorflow\python\client\session.py", line 11, in <module>
    from tensorflow.python import pywrap_tensorflow as tf_session
  File "C:\Users\Or\AppData\Local\Enthought\Canopy\User\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 28, in <module>
    _pywrap_tensorflow = swig_import_helper()
  File "C:\Users\Or\AppData\Local\Enthought\Canopy\User\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 20, in swig_import_helper
    import _pywrap_tensorflow
ImportError: No module named _pywrap_tensorflow

would be greatful, thanks!

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 15 (1 by maintainers)

Most upvoted comments

For windows users install Visual C++ 2015 redistributable (x64 version) to be able to import tensorflow

Also facing the issue tried to install the Microsoft Visual C++ 2015 Redistributable but when i checked the control panel it is already present there

image

Any Help plz ?

any solution for MAC users ?

Hi, I have laid down step-by-step instructions to successfully install Tensorflow on Windows.

https://github.com/bhavsarpratik/install_Tensorflow_GPU_windows

After installation of Visual C++ 2015 Redistributable it worked for me