ModuleNotFoundError: No module named 'keras'

Machine Learning

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'

If you want to unleash your potential in this competitive field, please visit the Machine Learning course page for more information, where you can find the Machine Learning tutorials and Machine Learning frequently asked interview questions and answers as well.

2
Answers

Replies

Here, the problem could be with the environment. This could be because the tensorflow module might haveĀ  been installed in a different environment. Hence, you can resolve this by uninstalling the keras module and installing it back again. Below is the code that will help in installation and uninstallation.


$ pip uninstall keras


$ pip install keras

 

It is because your TensorFlow module might be installed in an environment that is different from the environment where Keras is installed in. Uninstall the Keras module and install it again.



$ pip uninstall keras


$ pip install keras

 
 

This topic has been locked/unapproved. No replies allowed

Login to participate in this discussion.

Leave a reply

Before proceeding, please check your email for a verification link. If you did not receive the email, click here to request another.
WhatsApp
To Top