Description
What happened?
When installing xarray
version 2025.3.0 in a conda environment with the python version pinned to 3.11, the import of xarray.core.rolling
fails with ModuleNotFoundError: No module named 'xarray.core.rolling'
Below is a conda env file that allows the reproduction :
name: xarray_test_env
channels:
- conda-forge
dependencies:
- python=3.11
- xarray=2025.3.0
It should be noted that this issue is not present with python 3.12 or later. It is also not present for earlier versions of xarray.
What did you expect to happen?
import xarray.core.rolling
should not raise an error
Minimal Complete Verifiable Example
import xarray.core.rolling
MVCE confirmation
- Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue in xarray.
- Complete example — the example is self-contained, including all data and the text of any traceback.
- Verifiable example — the example copy & pastes into an IPython prompt or Binder notebook, returning the result.
- New issue — a search of GitHub Issues suggests this is not a duplicate.
- Recent environment — the issue occurs with the latest version of xarray and its dependencies.
Relevant log output
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'xarray.core.rolling'
Anything else we need to know?
#6844 could be related
Environment
xarray: 2025.3.0
pandas: 2.2.3
numpy: 2.2.4
scipy: None
netCDF4: None
pydap: None
h5netcdf: None
h5py: None
zarr: None
cftime: None
nc_time_axis: None
iris: None
bottleneck: None
dask: None
distributed: None
matplotlib: None
cartopy: None
seaborn: None
numbagg: None
fsspec: None
cupy: None
pint: None
sparse: None
flox: None
numpy_groupies: None
setuptools: 75.8.2
pip: 25.0.1
conda: None
pytest: None
mypy: None
IPython: None
sphinx: None