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.0 incompatibility #318

Closed
djhoese opened this issue Feb 6, 2024 · 0 comments · Fixed by #319
Closed

Numpy 2.0 incompatibility #318

djhoese opened this issue Feb 6, 2024 · 0 comments · Fixed by #319

Comments

@djhoese
Copy link
Contributor

djhoese commented Feb 6, 2024

To report a non-security related issue, please provide:

  • the version of the software with which you are encountering an issue: current master branch
  • environmental information (i.e. Operating System, compiler info, java version, python version, etc.): Python 3.12 with numpy 2.0 nightly wheel
  • a description of the issue with the steps needed to reproduce it:

Numpy 2.0 will now require that you call the C API level np.import_array() before using the C API in Cython extensions. Importing cftime with numpy 2.0 gives you:

../../../miniconda3/envs/test-environment/lib/python3.12/site-packages/cftime/__init__.py:1: in <module>
    from ._cftime import (datetime, real_datetime,
src/cftime/_cftime.pyx:1: in init cftime._cftime
    ???
E   ImportError: numpy.core.multiarray failed to import (auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; use '<void>numpy._import_array' to disable if you are certain you don't need it).

Note: Numpy 2.0 isn't out yet...but it will be.

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

Successfully merging a pull request may close this issue.

1 participant