How to install Keras if the required version of se

2019-03-06 01:19发布

问题:

I'm using conda 4.4.9. I have already installed TensorFlow and I want to install Keras as well.

Then I tried to activate my virtual environment and install Keras as below:-

activate tensorflow_env_001
pip install --ignore-installed --upgrade keras

Then I got the following error message:

tensorflow 1.9.0 has requirement setuptools<=39.1.0, but you'll have setuptools 39.2.0 which is incompatible

That means my setuptools is too new. In fact, I can run the TensorFlow codes without any error. But I just can't install Keras. I tried to update setuptools but that had just made the situation worse, as setuptools now become 40.0.0.

If I run conda list, and I will see this:-

That means all TensorFlow, Keras and setuptools are here. But when I tried to import Keras in my Python code, I just got ModuleNotFoundError: No module named 'keras'.

How can I properly install Keras? Many thanks!!

回答1:

tensorflow 1.9.0 has requirement setuptools<=39.1.0, but you'll have setuptools 39.2.0 which is incompatible

i got same error.To downgrade your setuptools version you can use

pip install setuptools==39.1.0

hope this helps further for keras installations.