Indeed, it turned out that using pip to install h5py loaded the latest version. Uninstalling the pip version and using sudo apt install python3-h5py loaded the correct version for Ubuntu 18.04. Now dolfin does not kick out any incompatibility errors. Thanks!