ModuleNotFoundError No module named keras

+1 vote

Hi Guys,

I installed keras module in my system. But when I tried to import this module I got this below error.

$ from keras.models import Sequential
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-7-9c5e0a19b646> in <module>
----> 1 from keras.models import Sequential
ModuleNotFoundError: No module named 'keras'
Apr 23, 2020 in Machine Learning by akhtar
• 38,260 points
45,315 views

1 answer to this question.

+2 votes
Best answer

Hi@akhtar,

I think this problem is related to the environment. Your TensorFlow module may be installed in a different env. and Keras is in a different env. So, try to uninstall the Keras module and reinstall it.

$ pip uninstall keras
$ pip install keras

Hope this will solve your error.

Read the Artificial Intelligence tutorial to learn more about Artificial Intelligence and Machine Learning. Also, enrol in Machine Learning Course to become proficient.

answered Apr 23, 2020 by MD
• 95,460 points

edited Aug 11, 2021 by Soumya
Could you please tell me from where to get the $ prompt so as to write the above commands. I am also facing the same problem as  mentioned above.