Skip to content

pmdarima is incompatible with numpy>=2.0.0 #577

Description

@nashafa

Describe the bug

Changes to numpy in v2.0.0 break the current version of pmdarima. Numpy 2.0 has significant breaking changes to its internal API, some of which are documented in their release notes.

To Reproduce

Install pmdarima without pinning numpy (i.e. install pmdarima with numpy>=2.0.0). Import pmdarima.

Versions

System:
    python: 3.12.4 (main, Jun 18 2024, 10:50:53) [Clang 15.0.0 (clang-1500.3.9.4)]
executable: /.../.venv/bin/python
   machine: macOS-14.5-arm64-arm-64bit

Python dependencies:
 setuptools: 70.0.0
        pip: None
    sklearn: 1.5.0
statsmodels: 0.14.2
      numpy: 1.26.4 # actually 2.0.0, but pmdarima won't import to get this output unless numpy is downgraded
      scipy: 1.13.1 # actually 1.14.2, 1.13 doesn't support numpy 2.0
     Cython: 3.0.10
     pandas: 2.2.2
     joblib: 1.4.2
   pmdarima: 2.0.4

Expected Behavior

Pmdarima should import and run as normal.

Actual Behavior

Pmdarima does not import.

Python 3.12.4 (main, Jun 18 2024, 10:50:53) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pmdarima
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/.../.venv/lib/python3.12/site-packages/pmdarima/__init__.py", line 52, in <module>
    from .arima import auto_arima, ARIMA, AutoARIMA, StepwiseContext, decompose
  File "/.../.venv/lib/python3.12/site-packages/pmdarima/arima/__init__.py", line 5, in <module>
    from .approx import *
  File "/.../.venv/lib/python3.12/site-packages/pmdarima/arima/approx.py", line 9, in <module>
    from ..utils.array import c, check_endog
  File "/.../.venv/lib/python3.12/site-packages/pmdarima/utils/__init__.py", line 5, in <module>
    from .array import *
  File "/.../.venv/lib/python3.12/site-packages/pmdarima/utils/array.py", line 13, in <module>
    from ._array import C_intgrt_vec
  File "pmdarima/utils/_array.pyx", line 1, in init pmdarima.utils._array
ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

Additional Context

I'm not too familiar with the inner workings or development of pmdarima or numpy. Please let me know if there's any further information I can provide or if there's something specific I can look into to fix any potential issues.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions