ImportError:Python3.7中没有名为“ _pywrap_tensorflow”的模块

时间:2019-05-16 10:35:56

标签: python tensorflow python-3.7

我正在用Python开发一个项目,我是这种语言的新手。执行代码时出现错误。

我正在将Windows10与Python3.7配合使用

我在执行代码时遇到此错误:

Using TensorFlow backend.
Traceback (most recent call last):
File “C:\Program Files (x86)\Python37–32\lib\site-packages\tensorflow\python\pywrap_tensorflow.py”, line 18, in swig_import_helper
fp, pathname, description = imp.find_module(‘_pywrap_tensorflow’, [dirname(file)])
File “C:\Program Files (x86)\Python37–32\lib\imp.py”, line 296, 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:\Program Files (x86)\Python37–32\lib\site-packages\tensorflow\python_init_.py”, line 54, in 
from tensorflow.python import pywrap_tensorflow
File “C:\Program Files (x86)\Python37–32\lib\site-packages\tensorflow\python\pywrap_tensorflow.py”, line 28, in 
_pywrap_tensorflow = swig_import_helper()
File “C:\Program Files (x86)\Python37–32\lib\site-packages\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 “E:\Python\cryptolover\lstm-bitcoin-prediction.py”, line 10, in 
from keras.models import Sequential
File “C:\Program Files (x86)\Python37–32\lib\site-packages\keras_init_.py”, line 3, in 
from . import utils
File “C:\Program Files (x86)\Python37–32\lib\site-packages\keras\utils_init_.py”, line 6, in 
from . import conv_utils
File “C:\Program Files (x86)\Python37–32\lib\site-packages\keras\utils\conv_utils.py”, line 9, in 
from .. import backend as K
File “C:\Program Files (x86)\Python37–32\lib\site-packages\keras\backend_init_.py”, line 89, in 
from .tensorflow_backend import *
File “C:\Program Files (x86)\Python37–32\lib\site-packages\keras\backend\tensorflow_backend.py”, line 5, in 
import tensorflow as tf
File “C:\Program Files (x86)\Python37–32\lib\site-packages\tensorflow_init_.py”, line 24, in 
from tensorflow.python import *
File “C:\Program Files (x86)\Python37–32\lib\site-packages\tensorflow\python_init_.py”, line 60, in 
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File “C:\Program Files (x86)\Python37–32\lib\site-packages\tensorflow\python\pywrap_tensorflow.py”, line 18, in swig_import_helper
fp, pathname, description = imp.find_module(‘_pywrap_tensorflow’, [dirname(file)])
File “C:\Program Files (x86)\Python37–32\lib\imp.py”, line 296, 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:\Program Files (x86)\Python37–32\lib\site-packages\tensorflow\python_init_.py”, line 54, in 
from tensorflow.python import pywrap_tensorflow
File “C:\Program Files (x86)\Python37–32\lib\site-packages\tensorflow\python\pywrap_tensorflow.py”, line 28, in 
_pywrap_tensorflow = swig_import_helper()
File “C:\Program Files (x86)\Python37–32\lib\site-packages\tensorflow\python\pywrap_tensorflow.py”, line 20, in swig_import_helper
import _pywrap_tensorflow
ModuleNotFoundError: No module named ‘_pywrap_tensorflow’

Error importing tensorflow. Unless you are using bazel,
you should not try to import tensorflow from its source directory;
please exit the tensorflow source tree, and relaunch your python interpreter
from there.

此错误可能是什么原因?

0 个答案:

没有答案