python tensorflow导入DLL加载失败
我安装了最新的
python 3.6.4 x64版本
然后使用pip3为cpu-only安装tensorflow C:&;pip3 install tensorflow 但是当我尝试在python中导入tensorflow时 它向我显示了以下错误 我确信我已经安装了Microsoft Visual C 2015 Redistributable(x64) 所以它不会是dll msvcp140.dll丢失的问题 它说“DLL加载失败,错误代码为-1073741795” 那么究竟是什么问题呢 我找不到有关此错误代码的任何其他信息 我的操作系统:Windows 7企业版服务包1/64位/英特尔酷睿i5 M 540 >>> import tensorflow Traceback (most recent call last): File "C:UsersAlanAppDataLocalProgramsPythonPython36libsite-packagest ensorflowpythonpywrap_tensorflow_internal.py",line 18,in swig_import_helper return importlib.import_module(mname) File "C:UsersAlanAppDataLocalProgramsPythonPython36libimportlib__ini t__.py",line 126,in import_module return _bootstrap._gcd_import(name[level:],package,level) File "<frozen importlib._bootstrap>",line 994,in _gcd_import File "<frozen importlib._bootstrap>",line 971,in _find_and_load File "<frozen importlib._bootstrap>",line 955,in _find_and_load_unlocked File "<frozen importlib._bootstrap>",line 658,in _load_unlocked File "<frozen importlib._bootstrap>",line 571,in module_from_spec File "<frozen importlib._bootstrap_external>",line 922,in create_module File "<frozen importlib._bootstrap>",line 219,in _call_with_frames_removed ImportError: DLL load failed with error code -1073741795 During handling of the above exception,another exception occurred: Traceback (most recent call last): File "C:UsersAlanAppDataLocalProgramsPythonPython36libsite-packagest ensorflowpythonpywrap_tensorflow.py",line 58,in <module> from tensorflow.python.pywrap_tensorflow_internal import * File "C:UsersAlanAppDataLocalProgramsPythonPython36libsite-packagest ensorflowpythonpywrap_tensorflow_internal.py",line 21,in <module> _pywrap_tensorflow_internal = swig_import_helper() File "C:UsersAlanAppDataLocalProgramsPythonPython36libsite-packagest ensorflowpythonpywrap_tensorflow_internal.py",line 20,in swig_import_helper return importlib.import_module('_pywrap_tensorflow_internal') File "C:UsersAlanAppDataLocalProgramsPythonPython36libimportlib__ini t__.py",level) ModuleNotFoundError: No module named '_pywrap_tensorflow_internal' During handling of the above exception,another exception occurred: Traceback (most recent call last): File "<stdin>",line 1,in <module> File "C:UsersAlanAppDataLocalProgramsPythonPython36libsite-packagest ensorflow__init__.py",line 24,in <module> from tensorflow.python import * File "C:UsersAlanAppDataLocalProgramsPythonPython36libsite-packagest ensorflowpython__init__.py",line 49,in <module> from tensorflow.python import pywrap_tensorflow File "C:UsersAlanAppDataLocalProgramsPythonPython36libsite-packagest ensorflowpythonpywrap_tensorflow.py",line 74,in <module> raise ImportError(msg) ImportError: Traceback (most recent call last): File "C:UsersAlanAppDataLocalProgramsPythonPython36libsite-packagest ensorflowpythonpywrap_tensorflow_internal.py",level) ModuleNotFoundError: No module named '_pywrap_tensorflow_internal' Failed to load the native TensorFlow runtime. See https://www.tensorflow.org/install/install_sources#common_installation_probl ems for some common reasons and solutions. Include the entire stack trace above this error message when asking for help. 解决方法
在win7 64bit(Intel Core 2 Duo Cpu T6670 2.2GHz)上,我遇到了与tensorflow1.6-CPU相同的问题
在我找到这个之后,它解决了我的问题. 参考此问题:https://github.com/tensorflow/tensorflow/issues/17386 由tensorflow-1.6.0-cp36-cp36m-win_amd64.whl:https://github.com/fo40225/tensorflow-windows-wheel/tree/master/1.6.0/py36/CPU/sse2重新安装 希望这个.whl可以帮助你. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |