1

I get the following errors during import of TensorFlow using Python 3.5.2.

Can anyone help with this?

>>> import tensorflow as tf
Traceback (most recent call last):
  File "C:\Users\zberenyi\AppData\Local\Programs\Python\Python35\lib\site-packag
es\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_hel
per
    return importlib.import_module(mname)
  File "C:\Users\zberenyi\AppData\Local\Programs\Python\Python35\lib\importlib\_
_init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 577, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 906, in create_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
ImportError: DLL load failed: A megadott eljárás nem található.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\zberenyi\AppData\Local\Programs\Python\Python35\lib\site-packag
es\tensorflow\python\pywrap_tensorflow.py", line 41, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\zberenyi\AppData\Local\Programs\Python\Python35\lib\site-packag
es\tensorflow\python\pywrap_tensorflow_internal.py", line 21, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\zberenyi\AppData\Local\Programs\Python\Python35\lib\site-packag
es\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_hel
per
    return importlib.import_module('_pywrap_tensorflow_internal')
  File "C:\Users\zberenyi\AppData\Local\Programs\Python\Python35\lib\importlib\_
_init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: 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\zberenyi\AppData\Local\Programs\Python\Python35\lib\site-packag
es\tensorflow\__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "C:\Users\zberenyi\AppData\Local\Programs\Python\Python35\lib\site-packag
es\tensorflow\python\__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "C:\Users\zberenyi\AppData\Local\Programs\Python\Python35\lib\site-packag
es\tensorflow\python\pywrap_tensorflow.py", line 52, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "C:\Users\zberenyi\AppData\Local\Programs\Python\Python35\lib\site-packag
es\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_hel
per
    return importlib.import_module(mname)
  File "C:\Users\zberenyi\AppData\Local\Programs\Python\Python35\lib\importlib\_
_init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 577, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 906, in create_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
ImportError: DLL load failed: A megadott eljárás nem található.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\zberenyi\AppData\Local\Programs\Python\Python35\lib\site-packag
es\tensorflow\python\pywrap_tensorflow.py", line 41, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\zberenyi\AppData\Local\Programs\Python\Python35\lib\site-packag
es\tensorflow\python\pywrap_tensorflow_internal.py", line 21, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\zberenyi\AppData\Local\Programs\Python\Python35\lib\site-packag
es\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_hel
per
    return importlib.import_module('_pywrap_tensorflow_internal')
  File "C:\Users\zberenyi\AppData\Local\Programs\Python\Python35\lib\importlib\_
_init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named '_pywrap_tensorflow_internal'

Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_probl ems

................

I have vc_redist.x64.exe and vs_community__35732741.1502806003.exe installed. I try to use the basic CPU form of TensorFlow. This was installed using:

pip3 install --upgrade tensorflow
Zoltan
  • 11
  • 2
  • Could you add the rest of your traceback? You removed the interesting part at the end. – André C. Andersen Aug 16 '17 at 10:44
  • I tried to include all of it but kept getting the message that since most of my text is code I should add more comment.. – Zoltan Aug 16 '17 at 13:20
  • Anyway: Tried to find some hints about this and most of the comments suggested to install cuda things. For CPU version I don't need cuda, do I? – Zoltan Aug 16 '17 at 13:21
  • You don't need CUDA if you're only doing CPU training. Looks like the traceback you where pasting into the comments got lost. You could add the traceback to a github gist: https://gist.github.com/ – André C. Andersen Aug 16 '17 at 13:26
  • I just managed to update the question with the full traceback. Pls see above.. – Zoltan Aug 16 '17 at 13:27
  • Ok. Now I see the traceback. Firstly, I recommend you use Anaconda for this. See the "Install with Anaconda" section [here](https://www.tensorflow.org/install/install_windows). Also, does [this](https://github.com/tensorflow/models/issues/1200#issuecomment-289235461) seem to be your issue. – André C. Andersen Aug 16 '17 at 13:31
  • In any case the key error message for you to start your search for a fix is `No module named '_pywrap_tensorflow_internal'`. – André C. Andersen Aug 16 '17 at 13:33
  • Related: https://stackoverflow.com/questions/35953210/error-running-basic-tensorflow-example – Vikash Singh Aug 16 '17 at 14:22
  • Hi André, I installed tensorflow with Anaconda - the test "Hello..." thing is now running in command window. With anaconda I also have Jupyter NB and just trying to follow a tutorial from https://github.com/Hvass-Labs/TensorFlow-Tutorials/blob/master/01_Simple_Linear_Model.ipynb – Zoltan Aug 21 '17 at 14:12
  • But right at input 1 I get the error message: ModuleNotFoundError Traceback (most recent call last) in () 1 get_ipython().magic('matplotlib inline') 2 import matplotlib.pyplot as plt ----> 3 import tensorflow as tf 4 import numpy as np 5 from sklearn.metrics import confusion_matrix ModuleNotFoundError: No module named 'tensorflow' – Zoltan Aug 21 '17 at 14:13
  • After some further trouble with Anaconda I decided to get rid of it and revert to pip installation. I found the solution for the original problem: one needs C++ 2015 Redistributable Update 3 from here: https://www.microsoft.com/en-us/download/details.aspx?id=53587. (Previously I just had C++ redistributable some other version..) Also installed Jupyter NB so now looking at tutorials.. – Zoltan Aug 23 '17 at 07:19

0 Answers0