TensorFlow导入报错:python310.dll版本冲突问题排查
导入TensorFlow触发ImportError错误
核心报错提示
Module use of python310.dll conflicts with this version of Python.
完整报错栈
ImportError Traceback (most recent call last) ~\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in <module> 61 try: ---> 62 from tensorflow.python._pywrap_tensorflow_internal import * 63 # This try catch logic is because there is no bazel equivalent for py_extension. ImportError: Module use of python310.dll conflicts with this version of Python. During handling of the above exception, another exception occurred: ImportError Traceback (most recent call last) <ipython-input-6-d6579f534729> in <module> ----> 1 import tensorflow ~\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorflow\__init__.py in <module> 35 import typing as _typing 36 ---> 37 from tensorflow.python.tools import module_util as _module_util 38 from tensorflow.python.util.lazy_loader import LazyLoader as _LazyLoader 39 ~\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorflow\python\__init__.py in <module> 34 # pylint: disable=wildcard-import,g-bad-import-order,g-import-not-at-top 35 ---> 36 from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow 37 from tensorflow.python.eager import context 38 ~\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in <module> 76 except ImportError: 77 raise ImportError( ---> 78 f'{traceback.format_exc()}' 79 f'\n\nFailed to load the native TensorFlow runtime.\n' 80 f'See https://www.tensorflow.org/install/errors ' ImportError: Traceback (most recent call last): File "C:\Users\Imran\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 62, in <module> from tensorflow.python._pywrap_tensorflow_internal import * ImportError: Module use of python310.dll conflicts with this version of Python.
补充说明
当前无法加载TensorFlow原生运行时,可查阅TensorFlow官方安装错误相关文档获取常见原因及解决方案;若需要进一步帮助,可在TensorFlow官方代码仓库提交issue并附上完整报错栈信息。
内容的提问来源于stack exchange,提问作者Imran Khan
相关产品推荐
相关产品推荐

