Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install keras module in python 2 environment conda?

I've already installed keras. It works in python 3 using spyder in conda. But when I run in python 2 (which is installed in an environment), it has an error ImportError: No module named keras.layers.core and when I try to install keras by using command prompt it said that I've already installed.

like image 334
Tanakorn Taweepoka Avatar asked Dec 07 '25 13:12

Tanakorn Taweepoka


1 Answers

To simplify the management of different environments in the same machine I use Conda. Create a new conda environment and specify the python version

conda create --name your_env_name python=2.7

Then activate the environment with

activate your_env_name

or

source activate your_env_name 

Now you can install keras in a new environment with

pip install keras
like image 102
paolof89 Avatar answered Dec 09 '25 02:12

paolof89



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!