cython: compilation error while building h5py (solved by workaround)
See original GitHub issueHello, here’s the error-logs and steps to reproduce when I try to rebuild h5py with python3/pip on ubuntu18.04.
- Operating System Ubuntu 18.04
- Python version 3.6
- Where Python was acquired: system Python on Linux
- h5py version: 2.10.0 (from pip)
- HDF5 version: 1.10.0
I provide a docker file to reproduce the problem locally, that you can run from a clean directory with
$ mv Dockerfile.txt Dockerfile
$ docker build .
Logs:
[...]
Error compiling Cython file:
------------------------------------------------------------
...
# --- open, open_by_name, open_by_idx ---
@with_phil
def open(ObjectID loc not None, char* name=NULL, int index=-1, *,
^
------------------------------------------------------------
h5py/h5a.pyx:54:32: Cannot convert 'void *' to Python object
[...]
which essentially does:
RUN python3 -m pip install --no-cache-dir mpi4py
RUN echo ------- available system libraries:; find /usr/lib -name "libhdf5.so*"; echo -------
RUN LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/hdf5/serial python3 -m pip install --no-cache-dir --no-binary=h5py h5py
Full log: log.txt
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:18 (7 by maintainers)
Top Results From Across the Web
Cython errors when compiling h5py with pip - Google Groups
to h5py. Hello all,. I'm running into some odd Cython errors when attempting to compile h5py from scratch with pip, e.g.: Error compiling...
Read more >h5py install on macbook m1 keeps failing - Stack Overflow
"Fixed".I tried it through macport and it works now. However, I still do not know why it does not work via pip. Here...
Read more >problem with Cython v 0.20.1 when installing h5py with mpi on ...
Hello everyone, I have been trying to install h5py with parallel HDF5 support into my. Ubuntu 12.04 machine. I have mpich2, and hdf5...
Read more >Failed building wheel for h5py on Jetpack 4.6.1 on Xavier NX
An error occurred in this step: Building wheel for h5py (pyprlject.toml) … error. Failed to build h5py. How to solve this problem?
Read more >Installation issue with h5py - FEniCS Discourse
If you installed h5py through pip3 you need to make sure you do not install another binary, i.e. pip3 install —no-binary=h5py h5py as...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It looks like there has been a recent change to the Cython API which must have broken h5py as fetched by pip.
Cloning the master branch on my machine and compiling from it worked all right. Hopefully, the fixed code will make its way to the tarball that pip fetches from.
I did some more digging into the problem. Actually, I was wrong regarding Cython. We did not have Cython installed. This means that when we install h5py with pip3 install h5py the installer downloads a temporary copy of Cython with version 3.0a1. Note that this is the latest release that was released 4/12/2020 (five days ago). With this version of Cython, pip3 install h5py fails as reported. OTOH, dowloading the sources from the master branch of the repo, and using pip3 install . compiles fine, still using Cython 3.0a1.
Finally, if we install Cython with pip3 install Cython which installs Cython version 0.29.16 before running pip3 install h5py the process runs smoothly and h5py installs fine.
To summarize: compiling the files from master branch work with latest version of Cython compiling files from tarball requires previous version of Cython
Hope this helps you guys fixing the problem.
On Fri, Apr 17, 2020 at 6:46 AM Thomas Kluyver notifications@github.com wrote: