找不到名为pywrap tensorflow的模块

时间:2019-04-12 12:42:56

标签: python-3.6

我没有安装必要的软件包,而是在导入keras或tensorflow时收到错误消息。我已经在路径中有msvcp140.dll。错误消息如下:    'C:\ Users \ admin> python     Python 3.6.5(v3.6.5:f59c0932b4,2018年3月28日,16:07:46)[MSC v.1900 32     位(整数     l)]在win32上     输入“帮助”,“版权”,“信用”或“许可证”以获取更多信息。

  
    
      

导入喀拉拉邦           使用TensorFlow后端           追溯(最近一次通话):           文件“ C:\ Users \ admin \ AppData \ Local \ Programs \ Python \ Python36-32 \ lib \ site-           包装           es \ tensorflow \ python \ pywrap_tensorflow.py“,第18行,在           swig_import_helper           fp,路径名,描述= imp.find_module('_ pywrap_tensorflow',           [dirname(_           _文件__)])           文件“ C:\ Users \ admin \ AppData \ Local \ Programs \ Python \ Python36-           32 \ lib \ imp.py”,李           ne 297,在find_module中           引发ImportError(_ERR_MSG.format(name),name = name)           ImportError:没有名为“ _pywrap_tensorflow”的模块

    
  
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\admin\AppData\Local\Programs\Python\Python36-32\lib\site- 
packag
es\tensorflow\python\__init__.py", line 66, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Users\admin\AppData\Local\Programs\Python\Python36-32\lib\site- 
packag
es\tensorflow\python\pywrap_tensorflow.py", line 28, in <module>
_pywrap_tensorflow = swig_import_helper()
File "C:\Users\admin\AppData\Local\Programs\Python\Python36-32\lib\site- 
packag
es\tensorflow\python\pywrap_tensorflow.py", line 20, in 
swig_import_helper
import _pywrap_tensorflow
ModuleNotFoundError: No module named '_pywrap_tensorflow'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\admin\AppData\Local\Programs\Python\Python36-32\lib\site- 
packag
es\keras\__init__.py", line 3, in <module>
from . import utils
File "C:\Users\admin\AppData\Local\Programs\Python\Python36-32\lib\site- 
packag
es\keras\utils\__init__.py", line 6, in <module>
from . import conv_utils
File "C:\Users\admin\AppData\Local\Programs\Python\Python36-32\lib\site- 
packag
es\keras\utils\conv_utils.py", line 9, in <module>
from .. import backend as K
File "C:\Users\admin\AppData\Local\Programs\Python\Python36-32\lib\site- 
packag
es\keras\backend\__init__.py", line 89, in <module>
from .tensorflow_backend import *
File "C:\Users\admin\AppData\Local\Programs\Python\Python36-32\lib\site- 
packag
es\keras\backend\tensorflow_backend.py", line 5, in <module>
import tensorflow as tf
File "C:\Users\admin\AppData\Local\Programs\Python\Python36-32\lib\site- 
packag
es\tensorflow\__init__.py", line 24, in <module>
from tensorflow.python import *
File "C:\Users\admin\AppData\Local\Programs\Python\Python36-32\lib\site- 
packag
es\tensorflow\python\__init__.py", line 72, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\admin\AppData\Local\Programs\Python\Python36-32\lib\site- 
packag
es\tensorflow\python\pywrap_tensorflow.py", line 18, in 
swig_import_helper
fp, pathname, description = imp.find_module('_pywrap_tensorflow', 
[dirname(_
_file__)])
File "C:\Users\admin\AppData\Local\Programs\Python\Python36- 
32\lib\imp.py", li
ne 297, in find_module
raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_pywrap_tensorflow'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\admin\AppData\Local\Programs\Python\Python36-32\lib\site- 
packag
es\tensorflow\python\__init__.py", line 66, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Users\admin\AppData\Local\Programs\Python\Python36-32\lib\site- 
packag
es\tensorflow\python\pywrap_tensorflow.py", line 28, in <module>
_pywrap_tensorflow = swig_import_helper()
File "C:\Users\admin\AppData\Local\Programs\Python\Python36-32\lib\site- 
packag
es\tensorflow\python\pywrap_tensorflow.py", line 20, in 
swig_import_helper
import _pywrap_tensorflow
ModuleNotFoundError: No module named '_pywrap_tensorflow'


Failed to load the native TensorFlow runtime.

See 

https://github.com/tensorflow/tensorflow/blob/master/tensorflow/g3doc/get_st     arted / os_setup.md#import_error

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.'



I have tried by installing msvcp140.dll many times, though it is not 
error shown above.

0 个答案:

没有答案