Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NumPy 2 support #2420

Closed
quasiben opened this issue May 2, 2024 · 5 comments
Closed

NumPy 2 support #2420

quasiben opened this issue May 2, 2024 · 5 comments

Comments

@quasiben
Copy link

quasiben commented May 2, 2024

To assist reproducing bugs, please include the following:

  • Operating System: Mac 14.4.1 (23E224))
  • Python version: 3.11
  • Where Python was acquired (e.g. system Python on MacOS or Linux, Anaconda on
    Windows)
  • h5py version: 3.11
  • HDF5 version: 1.14.3

I'm testing out a variety of pydata tools (as part of dask testing) with the release candidate for NumPy 2: 2.0.0rc1 . I'm getting an error on import of h5py and NumPy 2 installed. I searched the tracker and couldn't find anything related to NumPy 2 testing so I filed this to start the discussion.

╰─$ python -c 'import h5py'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/bzaitlen/miniforge3/envs/test-environment/lib/python3.11/site-packages/h5py/__init__.py", line 45, in <module>
    from ._conv import register_converters as _register_converters, \
  File "h5py/_conv.pyx", line 1, in init h5py._conv
  File "h5py/h5r.pyx", line 1, in init h5py.h5r
  File "h5py/h5p.pyx", line 1, in init h5py.h5p
ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject
@jakirkham
Copy link
Contributor

Thanks Ben! 🙏

How did you install h5py?

@quasiben
Copy link
Author

quasiben commented May 2, 2024

Through conda-forge:

h5py 3.11.0 nompi_py311hd00467f_100 conda-forge

@jakirkham
Copy link
Contributor

Think the conda-forge h5py won't work in this case as it hasn't been rebuilt with NumPy 2 yet. There is a plan to do so ( conda-forge/conda-forge-pinning-feedstock#5790 ), which likely starts soon

In the interim, maybe it is worth trying h5py wheels (assuming they have been built with NumPy 2)?

@tacaswell
Copy link
Member

I believe the pre-release wheels have been built with numpy2 but the released ones have not. I could be wrong about that though.

If you want to test numpy2 it is probably best to install h5py either from the repo of via pip install --no-build-isolation --no-binary h5py h5py.

@quasiben
Copy link
Author

quasiben commented May 4, 2024

Thanks @tacaswell ! The pip install command you noted worked. Closing

@quasiben quasiben closed this as completed May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants