Solution 1:

h5py for Python 2.x can be installed from the default repositories in Ubuntu 18.04 and earlier with the following command:

sudo apt install python-h5py

h5py for Python 3.x can be installed from the default repositories in all currently supported versions of Ubuntu with the following command:

sudo apt install python3-h5py  

HDF5 for Python (h5py) is a general-purpose Python interface to the Hierarchical Data Format library, version 5. HDF5 is a versatile, mature scientific software library designed for the fast, flexible storage of enormous amounts of data.