Before you start reading this post, make sure you have Python3+ installed.

How to update Python to Python3+

The easiest way to install Keras on Ubuntu is through Conda.

Conda Install Keras

Make sure you have Anaconda installed.

How to install Anaconda

Now run following command...

conda install keras

Verify Keras Installation

python3 -c 'import keras  as k; print(k.__version__)'
>> 2.4.3

Pip Install Keras

Another way of installing Keras is just with Pip.

With Pip first, you need to install all the packages that Conda installed it for us.

  1. Install OpenBLAS
sudo apt-get install build-essential cmake git unzip pkg-config libopenblas-dev liblapack-dev
  1. Install Numpy, Scipy, Matplotlib
sudo apt-get install python-numpy python-scipy python-matplotlib python-yaml
sudo pip3 install matplotlib
  1. Install HDF5
sudo apt-get install libhdf5-serial-dev python-h5py
  1. Install Graphviz, pydot-ng
sudo apt-get install graphviz
sudo pip3 install pydot-ng
  1. Install OpenCV
How To Install OpenCV On Ubuntu
Tutorial on how to install OpenCV for both Desktop and Server (headless) environments.
  1. Install TensorFlow
Install Tensorflow On Ubuntu
How to install Tensorflow on Ubuntu using pip3
  1. Install Keras
sudo pip3 install keras