scverse / squidpy

Spatial Single Cell Analysis in Python
https://squidpy.readthedocs.io/en/stable/
BSD 3-Clause "New" or "Revised" License
440 stars 82 forks source link

New xarray release (v2024.10.0) is breaking squidpy install #907

Closed ajulienla closed 1 week ago

ajulienla commented 3 weeks ago

I tried to install a brand new squidpy environemnt and the latest release of xarray is not working with the current implementation of squidpy (through datatree)

It seems the latest release broke functionalities eventhough I don't see it described in the release's log.

Below is a minimal example using uv but poetry/conda/pip would be the same.

uv init
uv add squidpy
uv run python -c "import squidpy"

 File "**/.venv/lib/python3.11/site-packages/datatree/datatree.py", line 33, in <module>
    from xarray.core.utils import (
ImportError: cannot import name 'HybridMappingProxy' from 'xarray.core.utils' (**/.venv/lib/python3.11/site-packages/xarray/core/utils.py)

Lowering & pinning xarray version works.

With the same install:

uv add "xarray<v2024.10.0"
uv run python -c "import squidpy"

This would be useful for now as a workaround for now in the toml to avoid new installation to fails.

Thanks !

Roger-GOAT commented 1 week ago

same issue. How to fix it??

ilan-gold commented 1 week ago

Fixed in 1.6.2 by upper bounding xarray for now