Michael Gee
Michael Gee

Reputation: 541

ImportError: No module named 'keras' in Pycharm

Hey guys I am currently having a problem where I am trying to do an import and I come across two problems within in my code where it says this:

Skip loading non-existent .env file /notebooks/app/.env
File "/notebooks/app/aime/predict/multimodal_aime_zeke_single_qs.py", line 35, in <module>
from app.aime.keras.callback.lightweight_progress_bar import LightweightProgressBar
File "/notebooks/app/aime/keras/callback/lightweight_progress_bar.py", line 5, in <module>
from keras.callbacks import Callback
ImportError: No module named 'keras'

And I then use this command:

pip list | grep -i keras

To realize that I do have keras listed from the command:

Keras (2.2.2)
Keras-Applications (1.0.4)
Keras-Preprocessing (1.0.2)

Can someone help please? Thanks!

Upvotes: 1

Views: 3318

Answers (2)

Dr. Mehmet Ali ATICI
Dr. Mehmet Ali ATICI

Reputation: 609

In File->Settings->Project->Project Interpreter screen, You can add keras by clicking + sign if exists among the available packages.

Upvotes: 1

ab123
ab123

Reputation: 357

Try installing keras with pip3 instead of pip; this should work if you are using python3.

pip3 install keras

Also check which directory keras is installed in and make sure that Pycharm is accessing that directory.

Upvotes: 0

Related Questions