importError Traceback (most recent call last)
~\anaconda3\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: DLL load failed while importing _pywrap_tensorflow_internal: The specified module could not be found.
During handling of the above exception, another exception occurred:
ImportError Traceback (most recent call last)
<ipython-input-1-370f0fe8bb94> in <module>
----> 1 import tensorflow
~\anaconda3\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
~\anaconda3\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 import pywrap_tensorflow as _pywrap_tensorflow
41 from tensorflow.python.eager import context
42
~\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>
77 sys.setdlopenflags(_default_dlopen_flags)
78 except ImportError:
---> 79 raise ImportError(
80 f'{traceback.format_exc()}'
81 f'\n\nFailed to load the native TensorFlow runtime.\n'
ImportError: Traceback (most recent call last):
File "C:\Users\user\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module>
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: The specified module could not be found.发布于 2022-01-14 19:30:55
您似乎正在使用anaconda环境,并且tensorflow无法在您的系统中正确安装。
为此,使用以下代码为tensorflow创建一个新的环境:
conda create -n tf tensorflow
conda activate tf
conda install pip
pip install tensorflow选择anaconda平台中的anaconda环境,并在相同的环境中打开JUPYTER notebook,然后再次键入以下代码:
import tensorflow as tf
printf(tf.__version__)如果没有错误,则表示成功安装了tensorflow。
请查看此链接以供参考。
https://stackoverflow.com/questions/70588763
复制相似问题