skm
skm

Reputation: 5649

No module names 'Keras'

I am absolutely new to the development of deep learning and currently, I am just preparing my system to start with some basic tutorials.

I followed the Tutorial on this Blog to prepare the environment for the development of deep leaning projects.

I was successful to do the steps mentioned in the tutorial expect the last one. I Installed tensorflow-gpu using the command pip install tensorflow-gpu in the Python 3.7 Anaconda.

enter image description here

PROBLEM: As per the tutorial, I should try to execute the following commands to check if everything went OK with the installation:

>>> import tensorflow
>>> import keras

The first command was exectued without any issue but the second command (i.e. import keras) is throwing error:

Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module names 'keras'

Upvotes: 1

Views: 1985

Answers (2)

AAKANKSHA JAIN
AAKANKSHA JAIN

Reputation: 47

You can import keras by pip (command for use).

pip install keras

After completion of above command you can check whether Keras install or not in your system by

pip list | grep -i keras

Output on console

DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.

Keras (2.2.4)

Keras-Applications (1.0.7)

Keras-Preprocessing (1.0.9)

Upvotes: 0

Tim
Tim

Reputation: 10709

You installed tensorflow, thats why you can import keras from tensorflow

from tensorflow import keras

Or you install keras separately with:

pip install keras 

and then import it with:

import keras 

Upvotes: 5

Related Questions