Installation of old version of h5py (2.10.0) fails

Hello,

As a dependency for another project I would like to install the old version of h5py==2.10.0 on a rolling-release linux system (manjaro) with pip 20.2.2 from /usr/lib/python3.9/site-packages/pip (python 3.9).

Running pip install h5py==2.10.0 leads to following error message:

Collecting h5py==2.10.0
  Using cached h5py-2.10.0.tar.gz (301 kB)
Requirement already satisfied: numpy>=1.7 in /usr/lib/python3.9/site-packages (from h5py==2.10.0) (1.19.4)
Requirement already satisfied: six in /usr/lib/python3.9/site-packages (from h5py==2.10.0) (1.15.0)
Installing collected packages: h5py
    Running setup.py install for h5py ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-mfjc2p9w/h5py/setup.py'"'"'; __file__='"'"'/tmp/pip-install-mfjc2p9w/h5py/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-yoa5iho8/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/user/.local/include/python3.9/h5py
         cwd: /tmp/pip-install-mfjc2p9w/h5py/
[...]
    In file included from /usr/lib/python3.9/site-packages/numpy/core/include/numpy/ndarrayobject.h:21,
                     from /usr/lib/python3.9/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                     from /tmp/pip-install-mfjc2p9w/h5py/h5py/api_compat.h:26,
                     from /tmp/pip-install-mfjc2p9w/h5py/h5py/h5i.c:654:
    At top level:
    /usr/lib/python3.9/site-packages/numpy/core/include/numpy/__multiarray_api.h:1463:1: warning: ‘_import_array’ defined but not used [-Wunused-function]
     1463 | _import_array(void)
          | ^~~~~~~~~~~~~
    error: command '/usr/bin/gcc' failed with exit code 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-mfjc2p9w/h5py/setup.py'"'"'; __file__='"'"'/tmp/pip-install-mfjc2p9w/h5py/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-yoa5iho8/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/user/.local/include/python3.9/h5py Check the logs for full command output.

This happens both when running with and without administrator rights. Any suggestion?

I suspect you’ll need to play with different versions of cython to get h5py 2.10 to build, I don’t think we released python 3.9 wheels for 2.10.

1 Like

Thanks for your answer. Indeed installing with python 3.7.7 worked well.