標籤:extern sage text turn ges fail lin site wrap
Windows下安裝完tensorflow後,在cmd下運行python後import tensorflow出現如下錯誤:
Traceback (most recent call last):
File “D:\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py”, line 18, in swig_import_helper
return importlib.import_module(mname)
File “D:\Python\Python35\lib\importlib__init__.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “frozen importlib._bootstrap”, line 986, in _gcd_import
File “frozen importlib._bootstrap”, line 969, in _find_and_load
File “frozen importlib._bootstrap”, line 958, in _find_and_load_unlocked
File “frozen importlib._bootstrap”, line 666, in _load_unlocked
File “frozen importlib._bootstrap”, line 577, in module_from_spec
File “frozen importlib._bootstrap_external”, line 906, in create_module
File “frozen importlib._bootstrap”, line 222, in _call_with_frames_removed
ImportError: DLL load failed: 找不到指定的模組。
(省略一些)。。。。。。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “D:\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow.py”, line 41, in module
from tensorflow.python.pywrap_tensorflow_internal import *
File “D:\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py”, line 21, in module
_pywrap_tensorflow_internal = swig_import_helper()
File “D:\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py”, line 20, in swig_import_helper
return importlib.import_module(‘_pywrap_tensorflow_internal’)
File “D:\Python\Python35\lib\importlib__init__.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named ‘_pywrap_tensorflow_internal’
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/install_sources#common_installation_problems
for some common reasons and solutions. Include the entire stack trace above this error message when asking for help.
博主在尋找問題解決方案的時候,有說需要安裝Anaconda,我是直接安裝的python3.5.3版本,沒有使用anaconda。又有的說需要安裝visual studio 2017,事實上只是vs2017剛好有運行tensorflow的環境,所以我們需要做的只是安裝缺少的環境即可。在下面的連結中下載對應版本(23位和64位),進行安裝就可以。
https://www.microsoft.com/en-us/download/details.aspx?id=53587
繼續在cmd下執行python,import tensorflow as tf,不報錯即說明安裝成功啦。
附上非官方windows下python extension packages的whl包連結:http://www.lfd.uci.edu/~gohlke/pythonlibs/
著作權聲明:
王老頭
出處:http://www.cnblogs.com/wmr95/p/7677791.html
本文著作權歸作者和部落格園共有,歡迎轉載,但未經作者同意必須保留此段聲明,並在文章頁面明顯位置給出原文連結,否則,作者將保留追究法律責任的權利。
Windows下安裝Tensorflow報錯 “DLL load failed:找不到指定的模組"