简体   繁体   English

导入错误:Python 3.8 中没有名为“_pywrap_tensorflow_internal”的模块

[英]ImportError: No module named '_pywrap_tensorflow_internal' with Python 3.8

I installed Python 3.8 and TensorFlow 1.12 on Windows 8, however, when writing this code (noting that I am not using Anaconda):我在 Windows 8 上安装了 Python 3.8 和 TensorFlow 1.12,但是,在编写此代码时(注意我没有使用 Anaconda):

import tensorflow as tf

I' m getting the following error:我收到以下错误:

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

I installed Python 3.8 and TensorFlow 1.12 on Windows 8我在 Windows 8 上安装了 Python 3.8 和 TensorFlow 1.12

This combination doesn't work.这种组合不起作用。 Python 3.8 was not supported when tensorflow (ie TF) was at version 1.12.当 tensorflow(即 TF)为 1.12 版本时,不支持 Python 3.8。 It only support when TF (2.2.0rc1,2.2.0rc2 ).它仅在TF (2.2.0rc1,2.2.0rc2 ) 时支持。 Please check on pypi, there are no files available for cp38 for 1.12 .请检查 pypi,没有可用于 cp38 的文件1.12

If you are looking for compatible python versions for TF 1.12 are 3.5 to 3.7.如果您正在寻找 TF 1.12 的兼容 python 版本,则为 3.5 到 3.7。 If you are facing any issues with this installation there may be reason with compiler please install MSVC 2015 update 3 .如果您在安装时遇到任何问题,可能是编译器有问题,请安装MSVC 2015 update 3

在此处输入图片说明

Please refer TF tested build configuration details for CPU and GPU .请参阅CPUGPU 的TF 测试构建配置详细信息。

If you don't have any concerns with TF version, I recommend you please install TF 2 which works on Windows 8 64-bit system.如果您对 TF 版本没有任何顾虑,我建议您安装 TF 2,它适用于 Windows 8 64 位系统。 Please refer more details here .在此处参考更多详细信息。

Note: After installation TF 2, if you are facing any DLL issues.注意:安装 TF 2 后,如果您遇到任何 DLL 问题。 Possible scenarios are可能的情况是

  1. You need to install the MSVC 2019您需要安装 MSVC 2019
  2. Your CPU/Python is on 32 bits你的 CPU/Python 是 32 位的
  3. Your CPU does not support AVX2 instructions您的 CPU 不支持 AVX2 指令
  4. There is a library that is in a different location/not installed on your system that cannot be loaded.有一个库位于不同的位置/未安装在您的系统上,无法加载。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ImportError:没有名为“ _pywrap_tensorflow_internal”的模块 - ImportError: No module named '_pywrap_tensorflow_internal' ImportError:在Python 3.5上没有名为“ _pywrap_tensorflow_internal”的模块 - ImportError: No module named '_pywrap_tensorflow_internal' at python 3.5 Tensorflow ImportError:Windows 10上没有名为“_pywrap_tensorflow_internal”的模块 - Tensorflow ImportError: No module named '_pywrap_tensorflow_internal' on Windows 10 如何修复“ImportError:没有名为&#39;_pywrap_tensorflow_internal&#39;的模块” - How to fix “ImportError: No module named '_pywrap_tensorflow_internal'” Tensorflow-没有名为&#39;_pywrap_tensorflow_internal&#39;的模块 - Tensorflow - No module named '_pywrap_tensorflow_internal' tensorflow:没有名为&#39;_pywrap_tensorflow_internal&#39;的模块 - tensorflow :No module named '_pywrap_tensorflow_internal' modulenotfounderror 没有名为“_pywrap_tensorflow_internal”的模块 - modulenotfounderror no module named '_pywrap_tensorflow_internal' 没有名为“_pywrap_tensorflow_internal”的模块 - No Module Named '_pywrap_tensorflow_internal' 没有名为“_pywrap_tensorflow_internal”的模块错误 - No module named '_pywrap_tensorflow_internal' Error tensorflow安装正确,但出现错误``ImportError:在导入tensorflow为tf时没有名为&#39;_pywrap_tensorflow_internal&#39;的模块 - tensorflow installed correctly but giving error "ImportError: No module named '_pywrap_tensorflow_internal' on import tensorflow as tf
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM