ModuleNotFoundError: No module named 'keras'

Ads
 

ModuleNotFoundError: No module named 'keras'

Hi,

I am using Anaconda python and trying to run a program developed by other team member in my machine. Here its saying ModuleNotFoundError: No module named 'keras'. How to install keras module?

Here is full log of error:

(tf12) [email protected]:~/textgeneration$ python 2.py
Traceback (most recent call last):
  File "2.py", line 11, in <module>
    from keras.callbacks import LambdaCallback
ModuleNotFoundError: No module named 'keras'
(tf12) [email protected]:~/textgeneration$

Thanks

View Answers

January 20, 2019 at 2:40 AM

Hi,

This error means keras python library is not installed on your python. You can install it with following command:

pip install keras

I just tested this command and it installed keras. Here is keras installation log:

(tf12) [email protected]:~/textgeneration$ pip install keras
Collecting keras
  Downloading https://files.pythonhosted.org/packages/5e/10/aa32dad071ce52b5502266b5c659451cfd6ffcbf14e6c8c4f16c0ff5aaab/Keras-2.2.4-py2.py3-none-any.whl (312kB)
    100% | 317kB 1.1MB/s 
Collecting pyyaml (from keras)
  Downloading https://files.pythonhosted.org/packages/9e/a3/1d13970c3f36777c583f136c136f804d70f500168edc1edea6daa7200769/PyYAML-3.13.tar.gz (270kB)
    100% | 276kB 992kB/s 
Requirement already satisfied: numpy>=1.9.1 in /home/deepak/anaconda3/envs/tf12/lib/python3.6/site-packages (from keras) (1.16.0)
Requirement already satisfied: h5py in /home/deepak/anaconda3/envs/tf12/lib/python3.6/site-packages (from keras) (2.9.0)
Requirement already satisfied: scipy>=0.14 in /home/deepak/anaconda3/envs/tf12/lib/python3.6/site-packages (from keras) (1.2.0)
Requirement already satisfied: keras-preprocessing>=1.0.5 in /home/deepak/anaconda3/envs/tf12/lib/python3.6/site-packages (from keras) (1.0.5)
Requirement already satisfied: six>=1.9.0 in /home/deepak/anaconda3/envs/tf12/lib/python3.6/site-packages (from keras) (1.12.0)
Requirement already satisfied: keras-applications>=1.0.6 in /home/deepak/anaconda3/envs/tf12/lib/python3.6/site-packages (from keras) (1.0.6)
Building wheels for collected packages: pyyaml
  Running setup.py bdist_wheel for pyyaml ... done
  Stored in directory: /home/deepak/.cache/pip/wheels/ad/da/0c/74eb680767247273e2cf2723482cb9c924fe70af57c334513f
Successfully built pyyaml
Installing collected packages: pyyaml, keras
Successfully installed keras-2.2.4 pyyaml-3.13

Thanks

Ads









Related Tutorials/Questions & Answers:
ModuleNotFoundError: No module named 'Keras'
ModuleNotFoundError: No module named 'Keras'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'Keras' How to remove the ModuleNotFoundError: No module named 'Keras'
ModuleNotFoundError: No module named 'keras'
ModuleNotFoundError: No module named 'keras'  Hi, I am using... machine. Here its saying ModuleNotFoundError: No module named 'keras'. How to install... ModuleNotFoundError: No module named 'keras' (tf12) [email protected]
Advertisements
ModuleNotFoundError: No module named 'keras'
ModuleNotFoundError: No module named 'keras'  Hi, I am using... machine. Here its saying ModuleNotFoundError: No module named 'keras'. How to install... ModuleNotFoundError: No module named 'keras' (tf12) [email protected]
ModuleNotFoundError: No module named 'keras'
ModuleNotFoundError: No module named 'keras'  Hi, I am using... machine. Here its saying ModuleNotFoundError: No module named 'keras'. How to install... ModuleNotFoundError: No module named 'keras' (tf12) [email protected]
ModuleNotFoundError: No module named 'cutmix-keras'
ModuleNotFoundError: No module named 'cutmix-keras'  Hi, My Python... 'cutmix-keras' How to remove the ModuleNotFoundError: No module named '... of cutmix-keras python library, ModuleNotFoundError: No module named 'cutmix
ModuleNotFoundError: No module named 'keras-rcnn'
ModuleNotFoundError: No module named 'keras-rcnn'  Hi, My Python... 'keras-rcnn' How to remove the ModuleNotFoundError: No module named '...-rcnn python library, ModuleNotFoundError: No module named 'keras-rcnn'
ModuleNotFoundError: No module named 'keras-batchflow'
ModuleNotFoundError: No module named 'keras-batchflow'  Hi, My... named 'keras-batchflow' How to remove the ModuleNotFoundError: No module named... the installation of keras-batchflow python library, ModuleNotFoundError: No module
ModuleNotFoundError: No module named 'keras-complex'
ModuleNotFoundError: No module named 'keras-complex'  Hi, My... 'keras-complex' How to remove the ModuleNotFoundError: No module named... the installation of keras-complex python library, ModuleNotFoundError: No module named '
ModuleNotFoundError: No module named 'keras-efficientnet'
ModuleNotFoundError: No module named 'keras-efficientnet'  Hi, My... named 'keras-efficientnet' How to remove the ModuleNotFoundError: No module..., ModuleNotFoundError: No module named 'keras-efficientnet' error will be solved
ModuleNotFoundError: No module named 'keras-efficientnets'
ModuleNotFoundError: No module named 'keras-efficientnets'  Hi, My...: No module named 'keras-efficientnets' error? Thanks   Hi..., ModuleNotFoundError: No module named 'keras-efficientnets' error
ModuleNotFoundError: No module named 'keras-microscopy'
ModuleNotFoundError: No module named 'keras-microscopy'  Hi, My... named 'keras-microscopy' How to remove the ModuleNotFoundError: No module...: No module named 'keras-microscopy' error will be solved. Thanks
ModuleNotFoundError: No module named 'keras-ernie'
ModuleNotFoundError: No module named 'keras-ernie'  Hi, My Python... 'keras-ernie' How to remove the ModuleNotFoundError: No module named '... of keras-ernie python library, ModuleNotFoundError: No module named 'keras-ernie
ModuleNotFoundError: No module named 'keras-eval'
ModuleNotFoundError: No module named 'keras-eval'  Hi, My Python... 'keras-eval' How to remove the ModuleNotFoundError: No module named '...-eval python library, ModuleNotFoundError: No module named 'keras-eval'
ModuleNotFoundError: No module named 'keras-genomics'
ModuleNotFoundError: No module named 'keras-genomics'  Hi, My... named 'keras-genomics' How to remove the ModuleNotFoundError: No module named... the installation of keras-genomics python library, ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'keras-gym'
ModuleNotFoundError: No module named 'keras-gym'  Hi, My Python... 'keras-gym' How to remove the ModuleNotFoundError: No module named 'keras... python library, ModuleNotFoundError: No module named 'keras-gym' error
ModuleNotFoundError: No module named 'keras-pandas'
ModuleNotFoundError: No module named 'keras-pandas'  Hi, My Python... 'keras-pandas' How to remove the ModuleNotFoundError: No module named '... of keras-pandas python library, ModuleNotFoundError: No module named 'keras
ModuleNotFoundError: No module named 'keras-htr'
ModuleNotFoundError: No module named 'keras-htr'  Hi, My Python... 'keras-htr' How to remove the ModuleNotFoundError: No module named 'keras... python library, ModuleNotFoundError: No module named 'keras-htr' error
ModuleNotFoundError: No module named 'keras-rnadam'
ModuleNotFoundError: No module named 'keras-rnadam'  Hi, My Python... 'keras-rnadam' How to remove the ModuleNotFoundError: No module named '... of keras-rnadam python library, ModuleNotFoundError: No module named 'keras
ModuleNotFoundError: No module named 'keras-segmentation'
ModuleNotFoundError: No module named 'keras-segmentation'  Hi, My... named 'keras-segmentation' How to remove the ModuleNotFoundError: No module..., ModuleNotFoundError: No module named 'keras-segmentation' error will be solved
ModuleNotFoundError: No module named 'keras_squeezenet'
ModuleNotFoundError: No module named 'keras_squeezenet'  Hi, My... named 'keras_squeezenet' How to remove the ModuleNotFoundError: No module...: No module named 'keras_squeezenet' error will be solved. Thanks
ModuleNotFoundError: No module named 'keras-svm'
ModuleNotFoundError: No module named 'keras-svm'  Hi, My Python... 'keras-svm' How to remove the ModuleNotFoundError: No module named 'keras... python library, ModuleNotFoundError: No module named 'keras-svm' error
ModuleNotFoundError: No module named 'Keras-TextClassification'
ModuleNotFoundError: No module named 'Keras-TextClassification'  Hi...: No module named 'Keras-TextClassification' How to remove the ModuleNotFoundError: No module named 'Keras-TextClassification' error? Thanks  
ModuleNotFoundError: No module named 'keras-tqdm'
ModuleNotFoundError: No module named 'keras-tqdm'  Hi, My Python... 'keras-tqdm' How to remove the ModuleNotFoundError: No module named '...-tqdm python library, ModuleNotFoundError: No module named 'keras-tqdm'
ModuleNotFoundError: No module named 'keras-unsupervised'
ModuleNotFoundError: No module named 'keras-unsupervised'  Hi, My... named 'keras-unsupervised' How to remove the ModuleNotFoundError: No module..., ModuleNotFoundError: No module named 'keras-unsupervised' error will be solved
ModuleNotFoundError: No module named 'keras-utils'
ModuleNotFoundError: No module named 'keras-utils'  Hi, My Python... 'keras-utils' How to remove the ModuleNotFoundError: No module named '... of keras-utils python library, ModuleNotFoundError: No module named 'keras-utils
ModuleNotFoundError: No module named 'nbeats-keras'
ModuleNotFoundError: No module named 'nbeats-keras'  Hi, My Python... 'nbeats-keras' How to remove the ModuleNotFoundError: No module named '... of nbeats-keras python library, ModuleNotFoundError: No module named 'nbeats
ModuleNotFoundError: No module named 'rosey-keras'
ModuleNotFoundError: No module named 'rosey-keras'  Hi, My Python... 'rosey-keras' How to remove the ModuleNotFoundError: No module named '... of rosey-keras python library, ModuleNotFoundError: No module named 'rosey-keras
ModuleNotFoundError: No module named 'seqtag-keras'
ModuleNotFoundError: No module named 'seqtag-keras'  Hi, My Python... 'seqtag-keras' How to remove the ModuleNotFoundError: No module named '... of seqtag-keras python library, ModuleNotFoundError: No module named 'seqtag
ModuleNotFoundError: No module named 'bidaf-keras'
ModuleNotFoundError: No module named 'bidaf-keras'  Hi, My Python... 'bidaf-keras' How to remove the ModuleNotFoundError: No module named '... of bidaf-keras python library, ModuleNotFoundError: No module named 'bidaf-keras
ModuleNotFoundError: No module named 'cutmix-keras'
ModuleNotFoundError: No module named 'cutmix-keras'  Hi, My Python... 'cutmix-keras' How to remove the ModuleNotFoundError: No module named '... of cutmix-keras python library, ModuleNotFoundError: No module named 'cutmix
ModuleNotFoundError: No module named 'dist-keras'
ModuleNotFoundError: No module named 'dist-keras'  Hi, My Python... 'dist-keras' How to remove the ModuleNotFoundError: No module named 'dist...-keras python library, ModuleNotFoundError: No module named 'dist-keras'

Ads