TensorFlow import error: no module named _pywrap_tensorflow

I am trying to configure TensorFlow on a Mac after TensorFlow install documents .

However, after completing the steps and trying to " import tensorflow as tf ", I get the following error trace:

 >>> import tensorflow as tf Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/site-packages/tensorflow/__init__.py", line 23, in <module> from tensorflow.python import * File "/usr/local/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 49, in <module> from tensorflow.python import pywrap_tensorflow File "/usr/local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 21, in <module> _pywrap_tensorflow = swig_import_helper() File "/usr/local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 20, in swig_import_helper return importlib.import_module('_pywrap_tensorflow') File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) ImportError: No module named _pywrap_tensorflow 

I have already installed and used TensorFlow on my machine before and have never encountered this problem.

+5
source share
2 answers

This part does not look right:

 File "/usr/local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 20, in swig_import_helper return importlib.import_module('_pywrap_tensorflow') File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) 

It uses pywrap_tensorflow from a Python installation in /usr/local/lib/python2.7 , but importlib from version /usr/local/Cellar/python/2.7.9 .

There should be something wrong with your Python package search path. See Keras Nadam import error for troubleshooting.

+2
source

Install x64 for the 64-bit version of Visual C ++, because MSVCP140.DLL may not be available on your system from https://www.microsoft.com/en-us/download/details.aspx?id=53587

0
source

Source: https://habr.com/ru/post/1260909/


All Articles