I was installing h5py on an Ubuntu server. However it seems to return an error that h5py.h
is not found. It gives the same error message when I install it using
You need to install libhdf5-dev to get the required header files. Just run
sudo apt-get install libhdf5-dev
and it should install it and its dependencies automatically.
Don't worry about the NumPy warning, it just means that the package developers are using an old version of the API, but everything will still work.
In my case (Ubuntu 15.04) installing libhdf5-dev
was not enough.
I had to run:
HDF5_DIR=/usr/lib/x86_64-linux-gnu/hdf5/serial/ pip install h5py
to make it work.
You can use python-h5py.
sudo apt-get install python-h5py
And then in your Python file try:
import h5py
I had to install both libhdf5-dev
and cython3
(Ubuntu 18.04 on arm64 device, Python 3.5).
sudo apt install libhdf5-dev
sudo apt install cython3
It is generally preferable to use pip
instead of installing it manually, since pip will also install all python dependencies. You would still need your header files though.
so:
sudo apt-get install libhdf5-dev
pip install h5py