有说需要安装Anaconda

时间:2022-04-10 17:17:36

  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 

  for some common reasons and solutions. Include the entire stack trace  above this error message when asking for help.

  博主在查找问题解决方案的时候,有说需要安置Anaconda,我是直接安置的python3.5.3版本,加密qq空间破解访问权限 ,没有使用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包链接:~gohlke/pythonlibs/

  

版权声明:

作者:王老头
来由:
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必需保存此段声明,并在文章页面明显位置给出原文链接,否则,作者将保存追究法令责任的权利。

Windows下安置Tensorflow报错 “DLL load failed:找不到指定的模块"