Error installing h5py package

I am trying to install the h5py package using the simple pip3 install h5py. However I get the following output with error:

root@pynq:/home/xilinx# pip3 install h5py
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with β€˜-m pip’ instead of running pip directly.
Collecting h5py
Downloading h5py-3.1.0.tar.gz (371 kB)
|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 371 kB 728 kB/s
ERROR: Disabling PEP 517 processing is invalid: project specifies a build backend of setuptools.build_meta in pyproject.toml
WARNING: You are using pip version 20.2.4; however, version 21.2.4 is available.
You should consider upgrading via the β€˜/usr/bin/python3 -m pip install --upgrade pip’ command.

I am using PYNQ version 2.6.0. What is the cause of this error? How can I solve it?

1 Like

You can pass --use-pep517 to your pip command. In PYNQ 2.6 we disabled PEP517 building (which builds the package in a clean python environment) by default as packages which depend on numpy can take multiple hours to install on a Zynq-7000 device and there were very packages out there that required it. If you want to change the global setting you can edit /etc/pip.conf

So using --use-pep517 can lead to hours of installation right?

Depends entirely on the setup requirements of the package you are installing. If numpy is amongst the requirements then you’re looking at about an hour, if scipy as well it will be considerably longer than that. A quick google indicates you may be able to pass the --no-build-isolation flag to avoid this but it’s not something I’ve tried. Unfortunately, as pypi doesn’t host any binary packages for 32-bit arm there is little we can do about it at the moment.

Peter

I tried with that solution, however I am still not able to install h5py. I get a really long error log
This is the very last part of it, I am not able to copy it all:

  aarch64-linux-gnu-gcc: numpy/core/src/multiarray/convert.c
      aarch64-linux-gnu-gcc: numpy/core/src/multiarray/convert_datatype.c
      aarch64-linux-gnu-gcc: numpy/core/src/multiarray/conversion_utils.c
      aarch64-linux-gnu-gcc: numpy/core/src/multiarray/ctors.c
      aarch64-linux-gnu-gcc: numpy/core/src/multiarray/datetime.c
      aarch64-linux-gnu-gcc: numpy/core/src/multiarray/datetime_strings.c
      aarch64-linux-gnu-gcc: numpy/core/src/multiarray/datetime_busday.c
      aarch64-linux-gnu-gcc: numpy/core/src/multiarray/datetime_busdaycal.c
      aarch64-linux-gnu-gcc: numpy/core/src/multiarray/descriptor.c
      aarch64-linux-gnu-gcc: numpy/core/src/multiarray/dtype_transfer.c
      aarch64-linux-gnu-gcc: build/src.linux-aarch64-3.6/numpy/core/src/multiarray/einsum.c
      aarch64-linux-gnu-gcc: numpy/core/src/multiarray/flagsobject.c
      aarch64-linux-gnu-gcc: numpy/core/src/multiarray/getset.c
      aarch64-linux-gnu-gcc: numpy/core/src/multiarray/hashdescr.c
      aarch64-linux-gnu-gcc: numpy/core/src/multiarray/item_selection.c
      aarch64-linux-gnu-gcc: numpy/core/src/multiarray/iterators.c
      aarch64-linux-gnu-gcc: build/src.linux-aarch64-3.6/numpy/core/src/multiarray/lowlevel_strided_loops.c
      aarch64-linux-gnu-gcc: numpy/core/src/multiarray/mapping.c
      aarch64-linux-gnu-gcc: numpy/core/src/multiarray/methods.c
      aarch64-linux-gnu-gcc: numpy/core/src/multiarray/multiarraymodule.c
      aarch64-linux-gnu-gcc: build/src.linux-aarch64-3.6/numpy/core/src/multiarray/nditer_templ.c
      aarch64-linux-gnu-gcc: numpy/core/src/multiarray/nditer_api.c
      aarch64-linux-gnu-gcc: numpy/core/src/multiarray/nditer_constr.c
      aarch64-linux-gnu-gcc: numpy/core/src/multiarray/nditer_pywrap.c
      aarch64-linux-gnu-gcc: numpy/core/src/multiarray/number.c
      aarch64-linux-gnu-gcc: numpy/core/src/multiarray/numpymemoryview.c
      aarch64-linux-gnu-gcc: numpy/core/src/multiarray/numpyos.c
      numpy/core/src/multiarray/numpyos.c:18:10: fatal error: xlocale.h: No such file or directory
       #include <xlocale.h>
                ^~~~~~~~~~~
      compilation terminated.
      numpy/core/src/multiarray/numpyos.c:18:10: fatal error: xlocale.h: No such file or directory
       #include <xlocale.h>
                ^~~~~~~~~~~
      compilation terminated.
      error: Command "aarch64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.6-3.
6.5=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPI
C -DHAVE_NPY_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -DHAVE_CBLAS -DATLAS_INFO="\"3.10.3\"" -Ibuild/src.
linux-aarch64-3.6/numpy/core/src/private -Inumpy/core/include -Ibuild/src.linux-aarch64-3.6/numpy/core/include/numpy -Inumpy/core/src/private -I
numpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/usr/include/
python3.6m -Ibuild/src.linux-aarch64-3.6/numpy/core/src/private -Ibuild/src.linux-aarch64-3.6/numpy/core/src/private -Ibuild/src.linux-aarch64-3
.6/numpy/core/src/private -c numpy/core/src/multiarray/numpyos.c -o build/temp.linux-aarch64-3.6/numpy/core/src/multiarray/numpyos.o" failed wit
h exit status 1
      ----------------------------------------
  ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-0
xal_d6f/numpy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-0xal_d6f/numpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);cod
e=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-a47lj
cr3/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-9ko5we8q/normal --compile --install-headers /tmp/pip-buil
d-env-9ko5we8q/normal/include/python3.6m/numpy Check the logs for full command output.
  WARNING: You are using pip version 20.2.4; however, version 21.2.4 is available.
  You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command.
  ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 /usr/local/lib/python3.6/dist-packages/pip install --ignore-installed --no-user
--prefix /tmp/pip-build-env-9ko5we8q/normal --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'num
py==1.12; python_version == "3.6"' 'numpy==1.17.5; python_version == "3.8"' 'numpy==1.19.3; python_version >= "3.9"' pkgconfig 'Cython>=0.29; py
thon_version < "3.8"' 'Cython>=0.29.14; python_version >= "3.8"' 'numpy==1.14.5; python_version == "3.7"' Check the logs for full command output

Which could be the problem?
.