Cannot install h5py

11,847

Solution 1

This link helped: https://github.com/Homebrew/legacy-homebrew/issues/23144

I installed LinuxHomeBrew and did:

brew tap homebrew/science
brew install hdf5
pip install h5py 

I was able to install h5py!

Solution 2

Your error is because you are missing the hdf5.h header, pip will not install the development headers, you need to install them using your package manager, on Centos it would be:

yum install hdf5-devel

If you look at the installation instrcutions:

Source installation on Linux and OS X

You need, via apt-get, yum or Homebrew:

Python 2.6, 2.7, 3.3, or 3.4 with development headers (python-dev or similar)

HDF5 1.8.4 or newer, shared library version with development headers (libhdf5-dev or similar)

NumPy 1.6.1 or later

Solution 3

sudo apt-get update

sudo apt-get install python-h5py

(Source)

Share:
11,847
esw12345
Author by

esw12345

Updated on June 04, 2022

Comments

  • esw12345
    esw12345 almost 2 years

    I'm trying to install h5py, but when I do pip install h5py or use python setup.py install from the source code, fatal error:

    hdf5.h: No such file or directory.
    

    Other posts mention to do pip install libhdf5-dev or pip install libhdf5-serial-dev to resolve this, but it says "no matching distribution found."

    How can I install h5py? I am ssh'd into an Odyssey computer using the CentOS 6.5 version of the Linux. Also, I do not have sudo privileges. Thanks!

  • esw12345
    esw12345 almost 8 years
    I don't have sudo privileges, is there any other command to install it? I am ssh'd into a virtual machine.
  • esw12345
    esw12345 almost 8 years
    I used LinuxHomeBrew and did: brew tap homebrew/science, then brew install hdf5, and then pip install h5py which worked! Thank you!
  • gansub
    gansub almost 8 years
  • soachishti
    soachishti over 6 years
    This is simplest and quicked way to install h5py in Raspbian.
  • Harry Moreno
    Harry Moreno over 6 years
    tap homebrew/science is deprecated fyi