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 '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 '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'
ModuleNotFoundError: No module named 'DSPP-Keras'
ModuleNotFoundError: No module named 'DSPP-Keras'  Hi, My Python... 'DSPP-Keras' How to remove the ModuleNotFoundError: No module named 'DSPP...-Keras python library, ModuleNotFoundError: No module named 'DSPP-Keras'
ModuleNotFoundError: No module named 'easy-keras'
ModuleNotFoundError: No module named 'easy-keras'  Hi, My Python... 'easy-keras' How to remove the ModuleNotFoundError: No module named 'easy...-keras python library, ModuleNotFoundError: No module named 'easy-keras'
ModuleNotFoundError: No module named 'evolutionary-keras'
ModuleNotFoundError: No module named 'evolutionary-keras'  Hi, My... named 'evolutionary-keras' How to remove the ModuleNotFoundError: No module..., ModuleNotFoundError: No module named 'evolutionary-keras' error will be solved
ModuleNotFoundError: No module named 'keras-facenet'
ModuleNotFoundError: No module named 'keras-facenet'  Hi, My... 'keras-facenet' How to remove the ModuleNotFoundError: No module named... the installation of keras-facenet python library, ModuleNotFoundError: No module named '
ModuleNotFoundError: No module named 'keras-fsl'
ModuleNotFoundError: No module named 'keras-fsl'  Hi, My Python... 'keras-fsl' How to remove the ModuleNotFoundError: No module named 'keras... python library, ModuleNotFoundError: No module named 'keras-fsl' error
ModuleNotFoundError: No module named 'keras-gcn'
ModuleNotFoundError: No module named 'keras-gcn'  Hi, My Python... 'keras-gcn' How to remove the ModuleNotFoundError: No module named 'keras... python library, ModuleNotFoundError: No module named 'keras-gcn' error
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-gtar'
ModuleNotFoundError: No module named 'keras-gtar'  Hi, My Python... 'keras-gtar' How to remove the ModuleNotFoundError: No module named '...-gtar python library, ModuleNotFoundError: No module named 'keras-gtar'
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-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-Preprocessing'
ModuleNotFoundError: No module named 'Keras-Preprocessing'  Hi, My...: No module named 'Keras-Preprocessing' error? Thanks   Hi..., ModuleNotFoundError: No module named 'Keras-Preprocessing' error
ModuleNotFoundError: No module named 'keras-progbar'
ModuleNotFoundError: No module named 'keras-progbar'  Hi, My... 'keras-progbar' How to remove the ModuleNotFoundError: No module named... the installation of keras-progbar python library, ModuleNotFoundError: No module named '
ModuleNotFoundError: No module named 'keras-radam'
ModuleNotFoundError: No module named 'keras-radam'  Hi, My Python... 'keras-radam' How to remove the ModuleNotFoundError: No module named '... of keras-radam python library, ModuleNotFoundError: No module named 'keras-radam
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-resnet'
ModuleNotFoundError: No module named 'keras-resnet'  Hi, My Python... 'keras-resnet' How to remove the ModuleNotFoundError: No module named '... of keras-resnet python library, ModuleNotFoundError: No module named 'keras
ModuleNotFoundError: No module named 'keras-adf'
ModuleNotFoundError: No module named 'keras-adf'  Hi, My Python... 'keras-adf' How to remove the ModuleNotFoundError: No module named 'keras... python library, ModuleNotFoundError: No module named 'keras-adf' error
ModuleNotFoundError: No module named 'Keras-Applications'
ModuleNotFoundError: No module named 'Keras-Applications'  Hi, My... named 'Keras-Applications' How to remove the ModuleNotFoundError: No module..., ModuleNotFoundError: No module named 'Keras-Applications' error will be solved
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_cli'
ModuleNotFoundError: No module named 'keras_cli'  Hi, My Python... 'keras_cli' How to remove the ModuleNotFoundError: No module named 'keras... python library, ModuleNotFoundError: No module named 'keras_cli' error
ModuleNotFoundError: No module named 'keras_clinical'
ModuleNotFoundError: No module named 'keras_clinical'  Hi, My... named 'keras_clinical' How to remove the ModuleNotFoundError: No module named... the installation of keras_clinical python library, ModuleNotFoundError: No module named
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-CoordConv'
ModuleNotFoundError: No module named 'Keras-CoordConv'  Hi, My... named 'Keras-CoordConv' How to remove the ModuleNotFoundError: No module named... the installation of Keras-CoordConv python library, ModuleNotFoundError: No module
ModuleNotFoundError: No module named 'keras-datasets'
ModuleNotFoundError: No module named 'keras-datasets'  Hi, My... named 'keras-datasets' How to remove the ModuleNotFoundError: No module named... the installation of keras-datasets python library, ModuleNotFoundError: No module named

Ads