Found a solution - I was trying to install on Python3.8.5 32bit. Switching to 64bit just solved the issue.
I saw that the latest version doesn't support win 32, check this: github.com/h5py/h5py/issues/1753
Use specific version of h5pyfor example you can use command:
pip install h5py==2.9.0
For windows use pip install versioned-hdf5
. This will workThen you can also install Keras easily.
I ran into the same problem while trying to install qiskit, which also (needed smth which needed smth which...) needed h5py.I got the same error message, but none of the answers here worked.
The first found workaround for me was installing h5py from https://www.lfd.uci.edu/~gohlke/pythonlibs/#h5py , which, although seems being quite on-own-risk, is also specified in https://docs.h5py.org/en/stable/build.html#wheels .
I used python 3.8 on Win7, 32 bit. For my purposes, installing h5py 3.4 did not work, but installing 2.1 did (I think the concrete package just needed 2.1 and ignored 3.4).
Commands used:
pip install <full path to downloaded .whl file, can be copied from file properties>pip install <wanted package, for me quiskit, for example>