-1

I am trying to execute the command
python -c "from keras import backend".
But while executing it I am getting the following error.


    (aind-cv) C:\Users\Harikesh>python -c "from keras import backend"
    Using TensorFlow backend.
    Traceback (most recent call last):
      File "C:\Users\Harikesh\Anaconda3\envs\aind-cv\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
        return importlib.import_module(mname)
      File "C:\Users\Harikesh\Anaconda3\envs\aind-cv\lib\importlib\__init__.py", line 126, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
      File "", line 985, in _gcd_import
      File "", line 968, in _find_and_load
      File "", line 957, in _find_and_load_unlocked
      File "", line 666, in _load_unlocked
      File "", line 577, in module_from_spec
      File "", line 938, in create_module
      File "", line 222, in _call_with_frames_removed
    ImportError: DLL load failed: The specified module could not be found.

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "C:\Users\Harikesh\Anaconda3\envs\aind-cv\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 41, in 
        from tensorflow.python.pywrap_tensorflow_internal import *
      File "C:\Users\Harikesh\Anaconda3\envs\aind-cv\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 21, in 
        _pywrap_tensorflow_internal = swig_import_helper()
      File "C:\Users\Harikesh\Anaconda3\envs\aind-cv\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
        return importlib.import_module('_pywrap_tensorflow_internal')
      File "C:\Users\Harikesh\Anaconda3\envs\aind-cv\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 "", line 1, in 
      File "C:\Users\Harikesh\Anaconda3\envs\aind-cv\lib\site-packages\keras\__init__.py", line 3, in 
        from . import utils
      File "C:\Users\Harikesh\Anaconda3\envs\aind-cv\lib\site-packages\keras\utils\__init__.py", line 6, in 
        from . import conv_utils
      File "C:\Users\Harikesh\Anaconda3\envs\aind-cv\lib\site-packages\keras\utils\conv_utils.py", line 9, in 
        from .. import backend as K
      File "C:\Users\Harikesh\Anaconda3\envs\aind-cv\lib\site-packages\keras\backend\__init__.py", line 84, in 
        from .tensorflow_backend import *
      File "C:\Users\Harikesh\Anaconda3\envs\aind-cv\lib\site-packages\keras\backend\tensorflow_backend.py", line 5, in 
        import tensorflow as tf
      File "C:\Users\Harikesh\Anaconda3\envs\aind-cv\lib\site-packages\tensorflow\__init__.py", line 24, in 
        from tensorflow.python import *
      File "C:\Users\Harikesh\Anaconda3\envs\aind-cv\lib\site-packages\tensorflow\python\__init__.py", line 51, in 
        from tensorflow.python import pywrap_tensorflow
      File "C:\Users\Harikesh\Anaconda3\envs\aind-cv\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 52, in 
        raise ImportError(msg)
    ImportError: Traceback (most recent call last):
      File "C:\Users\Harikesh\Anaconda3\envs\aind-cv\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
        return importlib.import_module(mname)
      File "C:\Users\Harikesh\Anaconda3\envs\aind-cv\lib\importlib\__init__.py", line 126, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
      File "", line 985, in _gcd_import
      File "", line 968, in _find_and_load
      File "", line 957, in _find_and_load_unlocked
      File "", line 666, in _load_unlocked
      File "", line 577, in module_from_spec
      File "", line 938, in create_module
      File "", line 222, in _call_with_frames_removed
    ImportError: DLL load failed: The specified module could not be found.

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "C:\Users\Harikesh\Anaconda3\envs\aind-cv\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 41, in 
        from tensorflow.python.pywrap_tensorflow_internal import *
      File "C:\Users\Harikesh\Anaconda3\envs\aind-cv\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 21, in 
        _pywrap_tensorflow_internal = swig_import_helper()
      File "C:\Users\Harikesh\Anaconda3\envs\aind-cv\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
        return importlib.import_module('_pywrap_tensorflow_internal')
      File "C:\Users\Harikesh\Anaconda3\envs\aind-cv\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_problems

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

I am using Anaconda and referred that website to solve the problem but it is not solved. I am trying to do the tasks provided in this. My tensorflow codes are working fine but I am unable to use keras only.


MBT
  • 21,733
  • 19
  • 84
  • 102
Harikesh
  • 152
  • 2
  • 12
  • I don't see any attempt to **install** *keras*, only attempt(s) to use it, failed because *tensorflow* (which is a dependency) is missing or incorrectly installed. Try `pip install keras` first. – CristiFati Apr 18 '18 at 06:47
  • I actually installed tensorflow, tensorflow-gpu and keras all were installed successfully. I already executed the command ```pip install kera```. – Harikesh Apr 18 '18 at 07:21

1 Answers1

0

As I cannot comment I am writing this as an answer. Make sure you have the lib MSVCP140.DLL. You can check in system->path variable. If not you can download it from here link. Also make sure you download the correct 32/64 bit for your system.

Also possible duplicate of this