tensorflow安装成功导入报错“找不到指定的模块”
在执行命令import tensorflow导入tensorflow时,报错,如下:Traceback (most recent call last):
File "D:\Program Files\Python38\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "D:\Program Files\Python38\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "D:\Program Files\Python38\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "D:\Program Files\Python38\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "D:\Program Files\Python38\lib\imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: 找不到指定的模块。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import tensorflow
File "D:\Program Files\Python38\lib\site-packages\tensorflow\__init__.py", line 41, in <module>
from tensorflow.python.tools import module_util as _module_util
File "D:\Program Files\Python38\lib\site-packages\tensorflow\python\__init__.py", line 50, in <module>
from tensorflow.python import pywrap_tensorflow
File "D:\Program Files\Python38\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 69, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "D:\Program Files\Python38\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "D:\Program Files\Python38\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "D:\Program Files\Python38\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "D:\Program Files\Python38\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "D:\Program Files\Python38\lib\imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: 找不到指定的模块。
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors
for some common reasons and solutions.Include the entire stack trace
above this error message when asking for help.
其中“DLL load failed while importing _pywrap_tensorflow_internal: 找不到指定的模块。”但是这个模块是有的。
不过我注意到与其他模块不一样的是,这个模块有一个“.lib”文件而其他模块都没有。
这个报错有没有大佬知道怎么解决,求解啊~~
有没有人呐自己顶一下。。。 Dxue 发表于 2020-6-24 18:26
有没有人呐自己顶一下。。。
https://blog.csdn.net/qq_41895190/article/details/82414353
看看这个
删了重装 xiaofeiyu 发表于 2020-6-24 20:56
删了重装
试了 没用。。。 问题解决了经验分享一下
我的python版本是3.8.2,直接命令行 pip install tensorflow 安装tensorflow,安装成功了,安装下来的是tensorflow 2.2.0,这是最新版的tensorflow
IDLE窗口中执行命令 import tensorflow,就出现了上述报错
直接说解决方法,覆盖安装python3.8.3,也就相当于升级了python
然后IDLE窗口中执行命令 import tensorflow,导入成功
网上各种解决方案五花八门,听着都不太可信,我电脑是新买的,不到俩月
所以什么依赖环境不对啊,我都没有试着解决
总而言之,问题的原因是tensorflow的版本与python的版本不兼容
其实看看tensorflow的历史版本,也大概能想到tensorflow为啥与python 3.8.2 版本不兼容了 Dxue 发表于 2020-6-25 12:00
问题解决了经验分享一下
我的python版本是3.8.2,直接命令行 pip install tensorflow 安装tensorflow ...
那也就是说tensorflow不支持382支持383? xiaofeiyu 发表于 2020-6-25 20:30
那也就是说tensorflow不支持382支持383?
是的目前来看最新版的tensorflow是这样的我也不知道为什么。。。 Dxue 发表于 2020-6-26 09:27
是的目前来看最新版的tensorflow是这样的我也不知道为什么。。。
好吧
页:
[1]