Registry / ai-ml / pmdarima

pmdarima

JSON →
library2.1.1pypypi✓ verified 30d ago

pmdarima is a Python library that provides an equivalent to R's `auto.arima` function, automating the process of selecting optimal ARIMA (AutoRegressive Integrated Moving Average) models for time series forecasting. It builds on `statsmodels` but offers a scikit-learn-like API, simplifying complex time series analysis. The library is currently at version 2.1.1 and receives regular updates for Python version compatibility and dependency support.

pip install pmdarima
INSTALL
IMPORT
SIG · PMDARIMA
P
pmdarima
ai-mlpythonv2.1.1
Install
18.6s avg
Import
6545ms
Disk
441MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v2.1.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
build_error
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 18.6s · import 5.236s · 426MB
441MB installed
● package 441MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

auto_arima
✓ from pmdarima import auto_arima
ARIMA
✓ from pmdarima.arima import ARIMA
✗ from pmdarima import ARIMA
ARIMA is located in the `pmdarima.arima` submodule, not directly under `pmdarima`.

This quickstart demonstrates how to use `pmdarima.auto_arima` to automatically select and fit an ARIMA model to a time series and generate future predictions. The example uses a simple synthetic dataset, fits the model, and then forecasts 10 future periods. Parameters like `start_p`, `start_q`, `max_p`, `max_q`, and `seasonal` control the search space for the optimal ARIMA model.

import pmdarima as pm import numpy as np import matplotlib.pyplot as plt # Generate some sample time series data y = np.random.rand(100) * 10 + np.arange(100) # Simple trend + noise # Fit a stepwise auto_arima model model = pm.auto_arima(y, start_p=1, start_q=1, test='adf', # use adftest to find optimal 'd' max_p=3, max_q=3, # maximum p and q m=1, # frequency of series d=None, # let model determine 'd' seasonal=False, # No seasonality start_P=0, D=0, trace=False, # Suppress verbose output error_action='ignore', suppress_warnings=True, stepwise=True) # Make predictions forecast, conf_int = model.predict(n_periods=10, return_conf_int=True) print("Forecast:", forecast) print("Confidence Interval:", conf_int) # Optional: plot results # plt.plot(y, label='Actual') # plt.plot(np.arange(len(y), len(y) + len(forecast)), forecast, label='Forecast') # plt.fill_between(np.arange(len(y), len(y) + len(forecast)), # conf_int[:, 0], conf_int[:, 1], alpha=0.1) # plt.legend() # plt.show()
Debug
Known issues
breakingVersion 2.1.0 removed support for Python 3.7, 3.8, and 3.9. Projects using these older Python versions must either remain on pmdarima < 2.1.0 or upgrade their Python environment.
fix
Upgrade Python to 3.10 or newer. As of v2.1.1, Python 3.10, 3.11, 3.12, 3.13, and 3.14 are supported.
affects: >=2.1.0
breakingVersion 2.1.0 introduced support for Numpy 2.x and simultaneously removed support for Numpy 1.x. Older projects might encounter build or runtime errors if Numpy is not updated.
fix
Ensure Numpy is upgraded to version 2.0.0 or newer.
affects: >=2.1.0
breakingVersion 2.1.0 increased the minimum required versions for SciPy to >=1.13.0 and Statsmodels to >=0.14.5. Using older versions of these dependencies will likely result in installation issues or runtime errors.
fix
Update SciPy to 1.13.0 or higher and Statsmodels to 0.14.5 or higher.
affects: >=2.1.0
gotchaThe `m` parameter (seasonal period) in `auto_arima` is not automatically detected and must be specified by the user. An incorrect `m` value can lead to suboptimal or erroneous seasonal models.
fix
Carefully determine the seasonal period (`m`) based on the data's characteristics (e.g., 12 for monthly data, 4 for quarterly data, 7 for daily data with weekly seasonality). Seasonal decomposition (`pmdarima.arima.model.tsdisplay`) or domain knowledge can help.
affects: All versions
deprecatedThe `exogenous` and `sarimax_kwargs` arguments to `ARIMA` and `auto_arima` were deprecated in earlier 1.x versions and will now raise a `TypeError` if used in 2.0.0 and later.
fix
Replace `exogenous` with the `X` parameter and `sarimax_kwargs` with direct keyword arguments passed to the underlying `SARIMAX` model via `**kwargs`.
affects: >=2.0.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pmdarima'
The `pmdarima` library is not installed in the Python environment currently being used, or the Python interpreter running the code is different from the one where `pmdarima` was installed.
fix
Ensure `pmdarima` is installed in the correct environment using `pip install pmdarima` or `conda install -c conda-forge pmdarima`. If using an IDE or Jupyter, verify that the active kernel/interpreter matches the installation location.
ERROR: Failed building wheel for pmdarima
`pmdarima` uses Cython and requires C/C++ compilers (build tools) to be present on the system for successful installation if a pre-built wheel is not available for your specific Python version and operating system. Outdated `pip`, `setuptools`, or `wheel` can also contribute to this.
ValueError: Could not successfully fit ARIMA to input data. It is likely your data is non-stationary. Please induce stationarity or try a different range of model order params.
The `auto_arima` function often encounters difficulty converging or finding an optimal model if the input time series data is non-stationary (exhibits trends or seasonality that haven't been accounted for by differencing) or if the search space for ARIMA orders is too constrained or inappropriate for the data.
ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject
This error typically arises due to an incompatibility between the installed version of `pmdarima` (or its underlying dependencies) and `NumPy`, usually when a `NumPy` version change (e.g., from 1.x to 2.x) breaks binary compatibility, requiring dependent packages to be recompiled or updated.
Upgrade
Version history
2.1.1latest on PyPI · released Nov 17, 2025
Audit
Dependencies
pythonrequiredRequired runtime environment
numpyrequiredCore numerical operations; v2.1.0 dropped support for Numpy 1.x
scipyrequiredScientific computing; minimum version increased in v2.1.0
statsmodelsrequiredUnderlying statistical models; minimum version increased in v2.1.0
pandasrequiredData structures and analysis
scikit-learnrequiredScikit-learn compatible API and utilities
joblibrequiredParallelization for `n_jobs`
CythonrequiredUsed for performance-critical sections and building from source
Agent activity
24 hits · last 30 days
node
18
Amazon
1
Resources
pmdarima — pip install pmdarima · libregistry