user2154591 February 2016

Error when importing TensorFlow in Python on Windows

I am running Python 2.7.10 and I successfully installed TensorFlow, using pip install https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl.

When I run the python interpreter and attempt to import the tensorflow module, I get the following 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

Answers


mrry February 2016

Judging by the paths in the output, it looks like you are trying to run TensorFlow on Windows. The package that you have installed is a Mac OS X binary distribution of TensorFlow.

Unfortunately, Windows is not currently supported by TensorFlow, and it is unlikely to be supported before its build system (Bazel) adds Windows support. There is some discussion of progress towards a Windows version on this GitHub issue, and an unsupported contribution that builds TensorFlow using CMake on Windows.

Post Status

Asked in February 2016
Viewed 2,447 times
Voted 11
Answered 1 times

Search




Leave an answer