In order to install Keras (https://keras.io/), use the following command:
$ pip install keras
To check whether the installation has been performed correctly, just open a Python shell and try to import the Keras library as follows:
python
import keras
Remember that a recommended approach is to install packages in virtual environments. Refer to Chapter 1, Setting Up OpenCV, in order to see how to create and manage virtual environments.