ModuleNotFoundError: No module named 'keras'

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) deepak@deepak-VirtualBox:~/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) deepak@deepak-VirtualBox:~/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) deepak@deepak-VirtualBox:~/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









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) deepak@deepak-VirtualBox
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) deepak@deepak-VirtualBox
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) deepak@deepak-VirtualBox
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-explain'
ModuleNotFoundError: No module named 'keras-explain'  Hi, My... 'keras-explain' How to remove the ModuleNotFoundError: No module named... the installation of keras-explain 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-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 'transparent-keras'
ModuleNotFoundError: No module named 'transparent-keras'  Hi, My... named 'transparent-keras' How to remove the ModuleNotFoundError: No module...: No module named 'transparent-keras' error will be solved. Thanks
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
ModuleNotFoundError: No module named 'keras-ding'
ModuleNotFoundError: No module named 'keras-ding'  Hi, My Python... 'keras-ding' How to remove the ModuleNotFoundError: No module named '...-ding python library, ModuleNotFoundError: No module named 'keras-ding'
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-ex'
ModuleNotFoundError: No module named 'keras-ex'  Hi, My Python... 'keras-ex' How to remove the ModuleNotFoundError: No module named 'keras-ex... library, ModuleNotFoundError: No module named 'keras-ex' error
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-nalu'
ModuleNotFoundError: No module named 'keras-nalu'  Hi, My Python... 'keras-nalu' How to remove the ModuleNotFoundError: No module named '...-nalu python library, ModuleNotFoundError: No module named 'keras-nalu'
ModuleNotFoundError: No module named 'keras-on-lstm'
ModuleNotFoundError: No module named 'keras-on-lstm'  Hi, My... 'keras-on-lstm' How to remove the ModuleNotFoundError: No module named... the installation of keras-on-lstm python library, ModuleNotFoundError: No module named '
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-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-retinanet'
ModuleNotFoundError: No module named 'keras-retinanet'  Hi, My... named 'keras-retinanet' How to remove the ModuleNotFoundError: No module named... the installation of keras-retinanet python library, ModuleNotFoundError: No module
ModuleNotFoundError: No module named 'keras-wrn'
ModuleNotFoundError: No module named 'keras-wrn'  Hi, My Python... 'keras-wrn' How to remove the ModuleNotFoundError: No module named 'keras... python library, ModuleNotFoundError: No module named 'keras-wrn' error
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 '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-FB'
ModuleNotFoundError: No module named 'Keras-FB'  Hi, My Python... 'Keras-FB' How to remove the ModuleNotFoundError: No module named 'Keras-FB... library, ModuleNotFoundError: No module named 'Keras-FB' 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-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 'libspn-keras'
ModuleNotFoundError: No module named 'libspn-keras'  Hi, My Python... 'libspn-keras' How to remove the ModuleNotFoundError: No module named '... of libspn-keras python library, ModuleNotFoundError: No module named 'libspn
ModuleNotFoundError: No module named 'nasbench-keras'
ModuleNotFoundError: No module named 'nasbench-keras'  Hi, My... named 'nasbench-keras' How to remove the ModuleNotFoundError: No module named... the installation of nasbench-keras python library, ModuleNotFoundError: No module named
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 'openml-keras'
ModuleNotFoundError: No module named 'openml-keras'  Hi, My Python... 'openml-keras' How to remove the ModuleNotFoundError: No module named '... of openml-keras python library, ModuleNotFoundError: No module named 'openml
ModuleNotFoundError: No module named 'plaidml-keras'
ModuleNotFoundError: No module named 'plaidml-keras'  Hi, My... 'plaidml-keras' How to remove the ModuleNotFoundError: No module named... the installation of plaidml-keras python library, ModuleNotFoundError: No module named '
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 'scikit-keras'
ModuleNotFoundError: No module named 'scikit-keras'  Hi, My Python... 'scikit-keras' How to remove the ModuleNotFoundError: No module named '... of scikit-keras python library, ModuleNotFoundError: No module named 'scikit
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 'transformer-keras'
ModuleNotFoundError: No module named 'transformer-keras'  Hi, My... named 'transformer-keras' How to remove the ModuleNotFoundError: No module...: No module named 'transformer-keras' error will be solved. Thanks
ModuleNotFoundError: No module named 'transformers-keras'
ModuleNotFoundError: No module named 'transformers-keras'  Hi, My... named 'transformers-keras' How to remove the ModuleNotFoundError: No module..., ModuleNotFoundError: No module named 'transformers-keras' error will be solved
ModuleNotFoundError: No module named 'vggish-keras'
ModuleNotFoundError: No module named 'vggish-keras'  Hi, My Python... 'vggish-keras' How to remove the ModuleNotFoundError: No module named '... of vggish-keras python library, ModuleNotFoundError: No module named 'vggish
ModuleNotFoundError: No module named 'xarray-keras'
ModuleNotFoundError: No module named 'xarray-keras'  Hi, My Python... 'xarray-keras' How to remove the ModuleNotFoundError: No module named '... of xarray-keras python library, ModuleNotFoundError: No module named 'xarray
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'
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'

Ads