2016-02-08 105 views
2

我正在運行Python 2.7.10,併成功安裝了TensorFlow,使用pip install https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl在Windows上導入TensorFlow Python時出錯

當我運行python解釋,並嘗試導入tensorflow模塊,我得到以下錯誤:

>>> 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 

回答

5

您可以使用畫中畫安裝tensorflow

pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.0rc0-cp35-cp35m-win_amd64.whl 

如果你要安裝在Windows上,你必須有python3.5 64位,並沿着你需要安裝Visual C++ 2015年可再發行組件( x64版本)能夠導入張量流程

+1

非常感謝。我安裝了tensorflow,版本是0.12.1。但仍有問題。在這個答案中安裝一個解決了這個問題。 – Tahlil

+2

安裝C++ 2015可再發行組件的確有竅門。謝謝。 –