简体   繁体   English

ImportError导入张量流

[英]ImportError importing tensorflow

While importing tensorflow i'm getting an error: 导入tensorflow出现错误:

import tensorflow
Traceback (most recent call last):
  File "C:\Users\Nik\AppData\Local\Programs\Python\Python37\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\Nik\AppData\Local\Programs\Python\Python37\lib\imp.py", line 297, 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\Nik\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\Nik\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\Nik\AppData\Local\Programs\Python\Python37\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'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Nik\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "C:\Users\Nik\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "C:\Users\Nik\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "C:\Users\Nik\AppData\Local\Programs\Python\Python37\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\Nik\AppData\Local\Programs\Python\Python37\lib\imp.py", line 297, 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\Nik\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\Nik\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\Nik\AppData\Local\Programs\Python\Python37\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'

Tensorflow is not supported on Python 3.7: Python 3.7不支持Tensorflow:

https://github.com/tensorflow/tensorflow/issues/17022 https://github.com/tensorflow/tensorflow/issues/17022

From this line in your trace back "C:\\Users\\Nik\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\tensorflow\\python\\pywrap_tensorflow_internal.py" I come to the conclusion that you are using python 3.7, python 3.7 doesn't support tensorflow as of yet, also it looks like you upgraded from python 3.6 given you didn't face a no module named tensorflow during your pip install. 从回溯的这一行"C:\\Users\\Nik\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\tensorflow\\python\\pywrap_tensorflow_internal.py"我得出结论,您正在使用python 3.7 ,python 3.7到目前为止还不支持tensorflow,而且由于您在pip安装过程中没有遇到no module named tensorflowno module named tensorflow因此您似乎已从python 3.6升级。

The only solution is to work with python 3.6 as of now, so you will either need to downgrade your python or install conda and create an environment with python 3.6 到目前为止,唯一的解决方案是使用python 3.6,因此您将需要降级python或安装conda并使用python 3.6创建环境

暂无
暂无

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

相关问题 导入张量流时的ImportError - ImportError when importing tensorflow 如何在导入Tensorflow时修复ImportError - How to fix ImportError when importing Tensorflow 导入错误:在导入 tensorflow 时找不到 &#39;cudnn64_7.dll&#39; - ImportError: Could not find 'cudnn64_7.dll' , while importing tensorflow TensorFlow ImportError - TensorFlow ImportError ImportError Tensorflow - ImportError Tensorflow Tensorflow: ImportError: DLL load failed while importing _pywrap_tensorflow_internal: 找不到指定的模块 - Tensorflow: ImportError: DLL load failed while importing _pywrap_tensorflow_internal: The specified module could not be found ImportError:DLL加载失败:动态链接库(DLL)初始化例程失败。(导入tensorflow错误) - ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.(importing tensorflow error) ImportError:/lib64/libc.so.6:导入张量流后找不到版本`GLIBC_2.15&#39; - ImportError: /lib64/libc.so.6: version `GLIBC_2.15' not found after importing tensorflow 导入 tensorflow 时,出现错误“导入错误:DLL 加载失败:找不到指定的模块。” - While importing tensorflow, got the error 'ImportError: DLL load failed: The specified module could not be found.' 导入 tensorflow 错误:ImportError: DLL load failed while importing _pywrap_tensorflow_internal: The specified module could not be found - Imporing tensorflow error: ImportError: DLL load failed while importing _pywrap_tensorflow_internal: The specified module could not be found
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM