1

I get this error whenever I try to import tensorFlow.

Traceback (most recent call last): File "C:\Users\Ali\AppData\Local\Programs\Python\Python36-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:\Users\Ali\AppData\Local\Programs\Python\Python36-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:\Users\Ali\AppData\Local\Programs\Python\Python36-32\lib\site-packages\tensorflow\python__init__.py", line 54, in from tensorflow.python import pywrap_tensorflow File "C:\Users\Ali\AppData\Local\Programs\Python\Python36-32\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 28, in _pywrap_tensorflow = swig_import_helper() File "C:\Users\Ali\AppData\Local\Programs\Python\Python36-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 "", line 1, in import tensorflow File "C:\Users\Ali\AppData\Local\Programs\Python\Python36-32\lib\site-packages\tensorflow__init__.py", line 24, in from tensorflow.python import * File "C:\Users\Ali\AppData\Local\Programs\Python\Python36-32\lib\site-packages\tensorflow\python__init__.py", line 60, in raise ImportError(msg) ImportError: Traceback (most recent call last): File "C:\Users\Ali\AppData\Local\Programs\Python\Python36-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:\Users\Ali\AppData\Local\Programs\Python\Python36-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:\Users\Ali\AppData\Local\Programs\Python\Python36-32\lib\site-packages\tensorflow\python__init__.py", line 54, in from tensorflow.python import pywrap_tensorflow File "C:\Users\Ali\AppData\Local\Programs\Python\Python36-32\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 28, in _pywrap_tensorflow = swig_import_helper() File "C:\Users\Ali\AppData\Local\Programs\Python\Python36-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.

kumail
  • 1,331
  • 4
  • 13
  • 19
  • Possible duplicate of [On Windows, running "import tensorflow" generates No module named "\_pywrap\_tensorflow" error](https://stackoverflow.com/questions/42011070/on-windows-running-import-tensorflow-generates-no-module-named-pywrap-tenso) – P-Gn Jul 08 '17 at 19:13
  • See also https://stackoverflow.com/questions/44526626/issues-running-tensorflow#comment76047812_44526626 – P-Gn Jul 08 '17 at 19:13
  • its not a duplicate – kumail Sep 15 '17 at 02:37
  • Fixed it, I had the wrong Python version installed... – kumail Dec 24 '17 at 01:01

0 Answers0