question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cython: compilation error while building h5py (solved by workaround)

See original GitHub issue

Hello, 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
[...]

Dockerfile.txt

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:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:18 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
ululi1970commented, Apr 15, 2020

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.

1reaction
ululi1970commented, Apr 17, 2020

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:

Yes, any change in master won’t be found until there’s a new release, which is not imminent at the moment.

If you want to install the stable version, you’ll need to identify what change has broken it (Cython 3?) and ensure you have a compatible version of that for building h5py.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/h5py/h5py/issues/1533#issuecomment-615178270, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACAM4Y4MW25C623SS5XIOZDRNAXQXANCNFSM4MIYVIRA .

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found