ImportError:没有名为'_pywrap_tensorflow_internal';使用Python 3.8
但是,在编写此代码时,我在Windows 8上安装了Python 3.8和TensorFlow 1.12(注意我没有使用Anaconda): 我收到以下错误:ImportError:没有名为'_pywrap_tensorflow_internal';使用Python 3.8,python,windows,tensorflow,visual-studio-code,tensorflow2.0,Python,Windows,Tensorflow,Visual Studio Code,Tensorflow2.0,但是,在编写此代码时,我在Windows 8上安装了Python 3.8和TensorFlow 1.12(注意我没有使用Anaconda): 我收到以下错误: Traceback (most recent call last): File "C:\Users\Dany\AppData\Local\Programs\Python\Python38-32\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", lin
Traceback (most recent call last):
File "C:\Users\Dany\AppData\Local\Programs\Python\Python38-32\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
fp, pathname, description = imp.find_module('_pywrap_tensorflow_internal', [dirname(__file__)])
File "C:\Users\Dany\AppData\Local\Programs\Python\Python38-32\lib\imp.py", line 296, in find_module
raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_pywrap_tensorflow_internal'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Dany\AppData\Local\Programs\Python\Python38-32\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\Dany\AppData\Local\Programs\Python\Python38-32\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\Dany\AppData\Local\Programs\Python\Python38-32\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
import _pywrap_tensorflow_internal
ModuleNotFoundError: No module named '_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.
File "C:\Users\Dany\Desktop\FYP\Python files\NN.py", line 1, in <module>
import tensorflow as tf
回溯(最近一次呼叫最后一次):
swig\u import\u helper中的文件“C:\Users\Dany\AppData\Local\Programs\Python38-32\lib\site packages\tensorflow\Python\pywrap\u tensorflow\u internal.py”第18行
fp,路径名,description=imp.find_模块(“pywrap_tensorflow_internal”,[dirname(u文件)]
文件“C:\Users\Dany\AppData\Local\Programs\Python 38-32\lib\imp.py”,第296行,在find\u模块中
引发导入错误(_ERR_MSG.format(name),name=name)
ImportError:没有名为“\u pywrap\u tensorflow\u internal”的模块
在处理上述异常期间,发生了另一个异常:
回溯(最近一次呼叫最后一次):
文件“C:\Users\Dany\AppData\Local\Programs\Python\Python38-32\lib\site packages\tensorflow\Python\pywrap\u tensorflow.py”,第58行,在
从tensorflow.python.pywrap\u tensorflow\u内部导入*
文件“C:\Users\Dany\AppData\Local\Programs\Python\Python38-32\lib\site packages\tensorflow\Python\pywrap\u tensorflow\u internal.py”,第28行,在
_pywrap\u tensorflow\u internal=swig\u import\u helper()
文件“C:\Users\Dany\AppData\Local\Programs\Python 38-32\lib\site packages\tensorflow\Python\pywrap\u tensorflow\u internal.py”,第20行,在swig\u import\u helper中
导入\u pywrap\u tensorflow\u内部
ModuleNotFoundError:没有名为“\u pywrap\u tensorflow\u internal”的模块
未能加载本机TensorFlow运行时。
看见https://www.tensorflow.org/install/errors
因为一些常见的原因和解决方案。包括整个堆栈跟踪
以上是请求帮助时的错误消息。
文件“C:\Users\Dany\Desktop\FYP\Python files\NN.py”,第1行,在
导入tensorflow作为tf
我在Windows8上安装了Python 3.8和TensorFlow 1.12
这种组合不起作用。tensorflow(即TF)在1.12版时不支持Python 3.8。它仅支持TF时(2.2.0rc1,2.2.0rc2
)。请检查pypi,没有可用于cp38的文件
如果您正在寻找TF1.12的兼容python版本,请选择3.5到3.7。如果您在安装过程中遇到任何问题,编译器可能有原因,请安装MSVC 2015更新3
有关和的详细信息,请参阅TF测试生成配置
如果您对TF版本没有任何顾虑,我建议您安装TF2,它可以在Windows 8 64位系统上运行。请参阅更多详情
注意:安装TF 2后,如果遇到任何DLL问题。可能的情况如下:
TF时(2.2.0rc1,2.2.0rc2
)。请检查pypi,没有可用于cp38的文件
如果您正在寻找TF1.12的兼容python版本,请选择3.5到3.7。如果您在安装过程中遇到任何问题,编译器可能有原因,请安装MSVC 2015更新3
有关和的详细信息,请参阅TF测试生成配置
如果您对TF版本没有任何顾虑,我建议您安装TF2,它可以在Windows 8 64位系统上运行。请参阅更多详情
注意:安装TF 2后,如果遇到任何DLL问题。可能的情况如下:
看起来他们已经给了你一个要检查的链接。你调查过了吗?因为在调查时,他们已经有了一个与你类似的问题:这是否回答了你的问题?我安装了Python3.5.3,现在出现另一个错误:我安装了Python3.5.3,现在出现另一个错误:ImportError:DLL加载失败:找不到指定的模块。所以我尝试在这里查看并安装lib MSVCP140.DLL,但没有成功。我认为它与我的版本不匹配,好像他们已经给了你一个要检查的链接。你调查过了吗?因为在调查时,他们已经有了一个与你类似的问题:这是否回答了你的问题?我安装了Python3.5.3,现在出现另一个错误:我安装了Python3.5.3,现在出现另一个错误:ImportError:DLL加载失败:找不到指定的模块。所以我试着看这里并安装lib MSVCP140.DLL,但它不起作用,我认为它与我的版本不匹配
Traceback (most recent call last):
File "C:\Users\Dany\AppData\Local\Programs\Python\Python38-32\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
fp, pathname, description = imp.find_module('_pywrap_tensorflow_internal', [dirname(__file__)])
File "C:\Users\Dany\AppData\Local\Programs\Python\Python38-32\lib\imp.py", line 296, in find_module
raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_pywrap_tensorflow_internal'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Dany\AppData\Local\Programs\Python\Python38-32\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\Dany\AppData\Local\Programs\Python\Python38-32\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\Dany\AppData\Local\Programs\Python\Python38-32\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
import _pywrap_tensorflow_internal
ModuleNotFoundError: No module named '_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.
File "C:\Users\Dany\Desktop\FYP\Python files\NN.py", line 1, in <module>
import tensorflow as tf