0

I got this error when I was try to import tensorflow at Windows10, python version 3.5 it is cpu verion, and I have MSVCP140.DLL.

I found lots of questions at SO, so I downgraded python to ver 3.5, and I installed MSVCP140.DLL.... What's wrong?

Traceback (most recent call last):
  File "E:\tensorflow_study\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
    fp, pathname, description = imp.find_module('_pywrap_tensorflow_internal', [dirname(__file__)])
  File "E:\tensorflow_study\tensorflow\lib\imp.py", line 296, in find_module
    raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "E:\tensorflow_study\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "E:\tensorflow_study\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "E:\tensorflow_study\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
    import _pywrap_tensorflow_internal
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 "E:\tensorflow_study\tensorflow\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "E:\tensorflow_study\tensorflow\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "E:\tensorflow_study\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "E:\tensorflow_study\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
    fp, pathname, description = imp.find_module('_pywrap_tensorflow_internal', [dirname(__file__)])
  File "E:\tensorflow_study\tensorflow\lib\imp.py", line 296, in find_module
    raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "E:\tensorflow_study\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "E:\tensorflow_study\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "E:\tensorflow_study\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
    import _pywrap_tensorflow_internal
ImportError: No module named '_pywrap_tensorflow_internal'


Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_problems

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

edit : I used this commend

pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.6.0-py3-none-any.whl

to install tensorflow. Is this made this error?

LegenDUST
  • 142
  • 9
  • 1
    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) – supersam654 Mar 04 '18 at 13:29
  • Do you have the right cuda and cudnn libraries installed? What version of tensorflow are you trying to install? – Alexandre Passos Mar 05 '18 at 18:01
  • @Alexandre Passos I have to install CUDNN and CUDA? CPU only version. I tried to install 1.6.0, but I can't find windows ver so I used that version. – LegenDUST Mar 06 '18 at 11:11
  • @supersam654 I HAVE MSVCP140.DLL, and mine is CPU only version.. – LegenDUST Mar 06 '18 at 11:13
  • If you have the CPU version you shouldn't need cudnn or cuda. If you're installing the py3 version of tensorflow you need to use pip3, not pip install – Alexandre Passos Mar 06 '18 at 22:14

1 Answers1

0

This is not directly related with CPU or GPU. Have been getting this error every now and then both in tesla GPUs and in mac's CPU. Lately I was using 1.13 version on osx and nothing I tried that is written on it's github or here worked until I updated to new beta version. Note that you have to change "keras" to "tensorflow.keras" when importing libraries.

pip install tensorflow==2.0.0-beta0 
Caner
  • 1,448
  • 23
  • 38