首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >ImportError: python39.dll的模块使用与此版本的Python冲突

ImportError: python39.dll的模块使用与此版本的Python冲突
EN

Stack Overflow用户
提问于 2021-04-26 02:02:44
回答 1查看 1.1K关注 0票数 0

我一直在尝试将Tensorflow导入到Python3虚拟环境中的jupypter笔记本中,但我得到了错误的结果。我还安装了Python2。

在虚拟环境中,我已经安装了这个包,使其在Jupyter笔记本中工作: tensorflow numpy (upgrade) ipy_kernel nb_conda

从Jupyter Notebook中,我可以选择安装了正确包的虚拟环境,也可以导入像numpy这样的包,但在尝试导入tensorflow时,我得到了这个错误:

代码语言:javascript
运行
复制
ImportError                               Traceback (most recent call last)
~\.conda\envs\py3-TF2.0\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>
     63   try:
---> 64     from tensorflow.python._pywrap_tensorflow_internal import *
     65   # This try catch logic is because there is no bazel equivalent for py_extension.

ImportError: Module use of python39.dll conflicts with this version of Python.

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
<ipython-input-2-fc0b9e4a13ce> in <module>
----> 1 from tensorflow.python._pywrap_tensorflow_internal import *

~\.conda\envs\py3-TF2.0\lib\site-packages\tensorflow\__init__.py in <module>
     39 import sys as _sys
     40 
---> 41 from tensorflow.python.tools import module_util as _module_util
     42 from tensorflow.python.util.lazy_loader import LazyLoader as _LazyLoader
     43 

~\.conda\envs\py3-TF2.0\lib\site-packages\tensorflow\python\__init__.py in <module>
     38 # pylint: disable=wildcard-import,g-bad-import-order,g-import-not-at-top
     39 
---> 40 from tensorflow.python.eager import context
     41 from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
     42 

~\.conda\envs\py3-TF2.0\lib\site-packages\tensorflow\python\eager\context.py in <module>
     33 from tensorflow.core.protobuf import config_pb2
     34 from tensorflow.core.protobuf import rewriter_config_pb2
---> 35 from tensorflow.python import pywrap_tfe
     36 from tensorflow.python import tf2
     37 from tensorflow.python.client import pywrap_tf_session

~\.conda\envs\py3-TF2.0\lib\site-packages\tensorflow\python\pywrap_tfe.py in <module>
     26 
     27 # pylint: disable=invalid-import-order,g-bad-import-order, wildcard-import, unused-import
---> 28 from tensorflow.python import pywrap_tensorflow
     29 from tensorflow.python._pywrap_tfe import *

~\.conda\envs\py3-TF2.0\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>
     81 for some common reasons and solutions.  Include the entire stack trace
     82 above this error message when asking for help.""" % traceback.format_exc()
---> 83   raise ImportError(msg)
     84 
     85 # pylint: enable=wildcard-import,g-import-not-at-top,unused-import,line-too-long

ImportError: Traceback (most recent call last):
  File "C:\Users\Tom\.conda\envs\py3-TF2.0\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module>
    from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: Module use of python39.dll conflicts with this version of Python.


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.
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-05-06 11:13:55

Tensorflow夜间版本支持所有操作系统的Python 3.9。

代码语言:javascript
运行
复制
pip install tf-nightly

请检查this线程。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67256661

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档