Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't install h5py

I am trying to h5py on Windows10 64bit, Python 3.8.5, Pip 20.2.4.

Used this command

pip install h5py

But this throws an error

ERROR: Could not build wheels for h5py which use PEP 517 and cannot be installed directly

Looks like it's quite known issue for pep 517 and other packages, so i try to check all of the solutions like

pip install --no-use-pep517 h5py
pip install --no-binary h5py

But nothing works. How can I install h5py?

like image 498
christian Avatar asked Jun 09 '26 07:06

christian


2 Answers

Installing versioned-hdf5 will solve this issue.

pip install versioned-hdf5

Now do pip install h5py

like image 90
Ezhilisai Avatar answered Jun 10 '26 20:06

Ezhilisai


I'm not sure if you're getting any other kind of dependencies errors besides this. In my case, I had additional details about the missing dependency libhdf5.so. It stated: "error: libhdf5.so cannot open shared object file: No such file or directory".

I checked the h5py documentation to make sure I had the right versions of pip and setuptools, https://pip.pypa.io/en/stable/reference/pip/.

pip install --upgrade pip setuptools wheel

I installed the libhdf5.so library by running below code and that solved it for me:

sudo apt-get install libhdf5-dev

I've come across similar PEP 517 errors caused by missing dependencies:

  1. ERROR: Could not build wheels for glpk which use PEP 517 and cannot be installed directly
  2. ERROR: Could not build wheels for scipy which use PEP 517 and cannot be installed directly

PEP 517 error

like image 29
Mleen Avatar answered Jun 10 '26 22:06

Mleen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!