qq_39829864
Tummer.
2021-01-12 22:45
采纳率: 100%
浏览 329
已采纳

为什么在pycharm里成功下载TensorFlow模块,却在import时报错

报错信息如下:

Traceback (most recent call last):
  File "D:\PycharmProjects\study\venv\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module>
    from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed: 找不到指定的模块。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:/PycharmProjects/study/TensorFlow/tensorflow入门.py", line 2, in <module>
    from tensorflow import keras
  File "D:\PycharmProjects\study\venv\lib\site-packages\tensorflow\__init__.py", line 41, in <module>
    from tensorflow.python.tools import module_util as _module_util
  File "D:\PycharmProjects\study\venv\lib\site-packages\tensorflow\python\__init__.py", line 39, in <module>
    from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
  File "D:\PycharmProjects\study\venv\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 83, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "D:\PycharmProjects\study\venv\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module>
    from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed: 找不到指定的模块。


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.

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • xiaosongshine
    小宋是呢 2021-01-13 14:15
    已采纳

    这是DLL load failed,就是DLL加载失败。分析原因可能是安装TF的时候没有安装完全。建议可以使用conda方法来组织Python环境。

    具体步骤可以仿照我的手把手博客内容:《『带你学AI』开发环境配置之Windows10篇:一步步带你在Windows平台开发深度学习(Windows上TensorFlow1与TensorFlow2的CPU与GPU安装与开发使用指南)》https://xiaosongshine.blog.csdn.net/article/details/112249592

    遇到问题欢迎在评论区讨论

    点赞 评论
  • weixin_45983573
    weixin_45983573 2021-01-14 23:24

    你好,可以说下在pytcharm上怎么安装tensorflow2吗?

    点赞 评论

相关推荐