cftime icon indicating copy to clipboard operation
cftime copied to clipboard

Numpy 2.0 incompatibility

Open djhoese opened this issue 1 year ago • 0 comments

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.

djhoese avatar Feb 06 '24 16:02 djhoese