5

I'm having trouble installing the Keras library for Python 3.6. Whenever I try to install Keras, it is throwing an error and when I searched on the internet, Keras had been released for up to Python 3.5. Does anyone have a solution for this?

Patrick Yoder
  • 1,065
  • 4
  • 14
  • 19
KRISHNA TEJA
  • 61
  • 1
  • 1
  • 6
  • Please show the error you are getting. Without it it's unlikely anyone will be able to help you. Your OS may also be relevant. – chrisis Jun 18 '17 at 07:59

4 Answers4

5

Follow this method if you have Anaconda and Python version 3.6.

First, create a new conda environment,

conda create -n keras python=3.5

Now activate it,

source activate keras

and install Keras,

conda install keras

Test if it works,

    $ python 
>>>import keras

You will get the following message if it was successful:

Using TensorFlow backend.

Click here to see Mike Müller's answer

Patrick Yoder
  • 1,065
  • 4
  • 14
  • 19
Jose Kj
  • 2,912
  • 2
  • 28
  • 40
2

I used sudo pip install keras to download.

I have both python 2.7 and 3.6 installed on my Mac. I used pip -V to check my python version of installation. Probably you used invalid version of python to download.

Screenshot of the install being done on my computer: Mac intallation screenshot

Charles
  • 1,121
  • 19
  • 30
LunaRivolxoxo
  • 330
  • 2
  • 5
1

Follow the below steps , Tensorflow dosnt support py3.7 as of now , so 3.6 is better ,
I recommend using environment , (venv , conda(preferred) ),

For conda

conda create -n keras python=3.6
source activate keras
conda install tensorflow keras
#for faster installation
pip install keras


For virtualenv

virtualenv -p python3 keras
source keras/bin/activate
pip install keras tensorflow numpy
yunus
  • 2,445
  • 1
  • 14
  • 12
1

Try the following at a command prompt:

pip install --upgrade tensorflow
pip install --upgrade keras

Also, refer the following link for more detail:

https://www.tensorflow.org/install/pip