John Sall
John Sall

Reputation: 1163

no module named keras after installing keras

I'm using anaconda ver 3, and I have installed python as well separately from anaconda. I installed python ver 2.7 and ver 3.6 from python website.

Now, I have installed keras from anaconda command prompt by using conda install keras. However, when I open jupyter notebook and write :

import keras

it says :

no module named keras

I also tried importing tensorflow but it gave me the same error

Upvotes: 0

Views: 293

Answers (2)

John Sall
John Sall

Reputation: 1163

Okay so what I did is first updated anaconda by using :

conda update conda

and then I installed python :

conda install python=3.7

and finally I installed keras again :

conda install keras

And now I can import both packages of keras and tenserflow

Upvotes: 0

Matt
Matt

Reputation: 186

As far as i know, keras is a version of tensorflow. You should try installing tensorflow instead and then run

import tensorflow as tf

tf.__version__

if you get '2.1.0' or any 2., you should be all set!

EDIT1: Keras is part of tensorflow not a version (as pointed out in the comments).

EDIT2: The link below gives good details on environments activation/creation.

https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html

Upvotes: 2

Related Questions