Skip to content

Cannot import xarray.core.rolling with xarray version 2025.3.0 and python 3.11 #10179

Open
@YassineAbdelouadoud

Description

@YassineAbdelouadoud

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

INSTALLED VERSIONS ------------------ commit: None python: 3.11.11 | packaged by conda-forge | (main, Mar 3 2025, 20:43:55) [GCC 13.3.0] python-bits: 64 OS: Linux OS-release: 5.4.0-198-generic machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: fr_FR.UTF-8 LOCALE: ('fr_FR', 'UTF-8') libhdf5: None libnetcdf: None

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

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