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

cf-units wheel on pypi not compatible with numpy2 #443

Open
Tracked by #450
heikoklein opened this issue Sep 10, 2024 · 2 comments
Open
Tracked by #450

cf-units wheel on pypi not compatible with numpy2 #443

heikoklein opened this issue Sep 10, 2024 · 2 comments
Labels
community New: Issue Highlight a new community raised "generic" issue Type: Bug Type: Infrastructure

Comments

@heikoklein
Copy link

🐛 Bug Report

Installing numpy-2 together with cf-units from pip is possible, but when running it, the following error is given:

venv/lib/python3.11/site-packages/iris/common/mixin.py:10: in <module>
    import cf_units
venv/lib/python3.11/site-packages/cf_units/__init__.py:23: in <module>
    from cf_units import _udunits2 as _ud
cf_units/_udunits2.pyx:1: in init cf_units._udunits2
    ???
E   ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

How to Reproduce

Steps to reproduce the behaviour:

  1. pip install "numpy>=2"
  2. pip install cf-units
  3. pip list
Package                Version
---------------------- -------
antlr4-python3-runtime 4.7.2
cf-units               3.2.0
cftime                 1.6.4
Jinja2                 3.1.4
MarkupSafe             2.1.5
numpy                  2.1.1
pip                    22.0.2
setuptools             59.6.0
  1. python -mcf_units
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 187, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/lib/python3.10/runpy.py", line 146, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/usr/lib/python3.10/runpy.py", line 110, in _get_module_details
    __import__(pkg_name)
  File "/home/heikok/cfunits2/lib/python3.10/site-packages/cf_units/__init__.py", line 23, in <module>
    from cf_units import _udunits2 as _ud
  File "cf_units/_udunits2.pyx", line 1, in init cf_units._udunits2
ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

Expected Behaviour

cf-units should work together with numpy2.
or cf-units should be marked incompatible with numpy2

Environment

  • OS & Version: Ubuntu 22.04 LTS
  • cf-units Version: 3.2.0
@ocefpaf
Copy link
Member

ocefpaf commented Sep 10, 2024

Needs #427
In a way, past builds will require a numpy<2 pin to keep working.

@trexfeathers
Copy link
Collaborator

#488 fixes, just waiting for a release now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community New: Issue Highlight a new community raised "generic" issue Type: Bug Type: Infrastructure
Projects
Status: No status
Status: Ready
Development

No branches or pull requests

4 participants