-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot import xarray.core.rolling with xarray version 2025.3.0 and python 3.11 #10179
Comments
Thanks for opening your first issue here at xarray! Be sure to follow the issue template! |
for reference, anything in What are you using cc @max-sixty Edit: oh, wait, I didn't notice that this only happens on
This always fails for me, regardless of the python version used to create the environment. |
I am not using the private API directly, but it is used by linopy in expressions.py But I see now that their latest version has the following code at the beginning :
So my issue comes down to using an outdated version of linopy. |
As suspected, that import appears to be for type hinting purposes. I guess that means we should provide a stable import path / an official way for type hinting the return values of our various operations that return intermediate objects. @pydata/xarray, what do you think? |
Makes sense to me. |
Yes, good idea. What's the best place for that? |
|
|
Hi all, I've recently joined B-Open and started working with xarray and would love to get more involved as a contributor. I have a couple of questions to better understand how you'd approach this:
Thanks for your help and for maintaining such a great library! Best, |
hi @micguerr-bopen ! that would be very welcome! I think we can start with just we could add a docstring saying these are public API and can be referenced by other libraries |
I'd probably choose whatever is in the docs for a first pass, and only then go through the code to see what's missing (which we should then also document) |
What happened?
When installing
xarray
version 2025.3.0 in a conda environment with the python version pinned to 3.11, the import ofxarray.core.rolling
fails withModuleNotFoundError: No module named 'xarray.core.rolling'
Below is a conda env file that allows the reproduction :
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 errorMinimal Complete Verifiable Example
MVCE confirmation
Relevant log output
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
The text was updated successfully, but these errors were encountered: