h5py: h5py fails to import hdf5 libraries

On Ubuntu 15, I have:

  • the most recent version of libhdf5-dev installed
  • the most recent version of libhdf5-serial-dev installed
  • h5py installed through pip3 and already up to date

Although it used to work properly, h5py now fails immediately:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.4/dist-packages/h5py/__init__.py", line 13, in <module>
    from . import _errors
ImportError: libhdf5_serial.so.8: cannot open shared object file: No such file or directory

I do have /usr/lib/x86_64-linux-gnu/libhdf5_serial.so.10, so it seems h5py cannot deal with a newer version of hdf5?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 16 (5 by maintainers)

Most upvoted comments

I had the same problem. Using pip, uninstalling then reinstalling h5py fixed the issue.

Yes, and it’s not intuitive how to do it, as pip tends to reinstall in the exact same way. What worked for me was

pip uninstall h5py pip install --no-cache-dir h5py

I’m getting this error installing into a python3.8 environment 😦

@molly87qd You should take this issue to your local administrator.

Failing that, unless you must use system python, I strongly suggest using a virtual enviroment of some sort (either python3 -m venv or conda) in user-space.

@martinosorb I am sorry, but I am new to linux(Centos). Could you tell me the steps to proceed to remove error

Thanks