cannot import spatialdata
Dear : I am running to process the Xenium data. When I try to import the spatialdata package, there always exists such error . The error shows something like the dask package can not support. I try some methods to solve this dependency problems but failed.
I am having the same issue:
import [my_package] Traceback (most recent call last): File "
", line 1, in import [my_package] File "/central/home/kvonemst/scripts/[my_package]/src/[my_package]/init.py", line 5, in from .analysis import Analyzer File "/central/home/kvonemst/scripts/[my_package]/src/[my_package]/analysis.py", line 6, in import spatialdata as sd File "/central/home/kvonemst/.local/share/hatch/env/virtual/[my_package]/si4t_XCl/dev/lib/python3.13/site-packages/spatialdata/init.py", line 6, in import dask.dataframe as dd File "/central/home/kvonemst/.local/share/hatch/env/virtual/[my_package]/si4t_XCl/dev/lib/python3.13/site-packages/dask/dataframe/init.py", line 14, in _dask_expr_enabled() ~~~~~~~~~~~~~~~~~~^^ File "/central/home/kvonemst/.local/share/hatch/env/virtual/[my_package]/si4t_XCl/dev/lib/python3.13/site-packages/dask/dataframe/init.py", line 9, in _dask_expr_enabled raise NotImplementedError("The legacy implementation is no longer supported") NotImplementedError: The legacy implementation is no longer supported
with the following environment:
aiobotocore==2.5.4 aiohappyeyeballs==2.6.1 aiohttp==3.11.14 aioitertools==0.12.0 aiosignal==1.3.2 anndata==0.11.3 annotated-types==0.7.0 array_api_compat==1.11.2 asciitree==0.3.3 astropy==7.0.1 astropy-iers-data==0.2025.3.24.0.35.32 attrs==25.3.0 black==25.1.0 botocore==1.31.17 cachetools==5.5.2 certifi==2025.1.31 cfgv==3.4.0 chardet==5.2.0 charset-normalizer==3.4.1 click==8.1.8 cloudpickle==3.1.1 colorama==0.4.6 colorcet==3.1.0 contourpy==1.3.1 coverage==7.7.1 cycler==0.12.1 dask==2025.3.0 dask-image==2024.5.3 datashader==0.17.0 Deprecated==1.2.18 distlib==0.3.9 distributed==2025.3.0 fasteners==0.19 filelock==3.18.0 fonttools==4.56.0 frozenlist==1.5.0 fsspec==2023.6.0 geopandas==1.0.1 h5py==3.13.0 identify==2.6.9 idna==3.10 imageio==2.37.0 iniconfig==2.1.0 isort==6.0.1 Jinja2==3.1.6 jmespath==1.0.1 joblib==1.4.2 kiwisolver==1.4.8 lazy_loader==0.4 llvmlite==0.44.0 locket==1.0.0 markdown-it-py==3.0.0 MarkupSafe==3.0.2 matplotlib==3.10.1 mdurl==0.1.2 msgpack==1.1.0 multidict==6.2.0 multipledispatch==1.0.0 multiscale_spatial_image==1.0.1 mypy==1.15.0 mypy-extensions==1.0.0 natsort==8.4.0 networkx==3.4.2 nodeenv==1.9.1 numba==0.61.0 numcodecs==0.15.1 numpy==2.1.3 ome-zarr==0.10.3 opencv-python==4.11.0.86 packaging==24.2 pandas==2.2.3 param==2.2.0 partd==1.4.2 pathspec==0.12.1 photutils==2.2.0 pillow==11.1.0 PIMS==0.7 pip==25.0.1 platformdirs==4.3.7 pluggy==1.5.0 pooch==1.8.2 pre_commit==4.2.0 propcache==0.3.0 psutil==7.0.0 pyarrow==19.0.1 pyct==0.5.0 pydantic==2.10.6 pydantic_core==2.27.2 pyerfa==2.0.1.5 Pygments==2.19.1 pyogrio==0.10.0 pyparsing==3.2.3 pyproj==3.7.1 pyproject-api==1.9.0 pyserial==3.5 pytest==8.3.5 pytest-cov==6.0.0 python-dateutil==2.9.0.post0 pytz==2025.2 PyYAML==6.0.2 requests==2.32.3 rich==13.9.4 s3fs==2023.6.0 scikit-image==0.25.2 scikit-learn==1.6.1 scipy==1.15.2 setuptools==78.0.2 shapely==2.0.7 six==1.17.0 slicerator==1.1.0 sortedcontainers==2.4.0 spatial_image==1.1.0 spatialdata==0.2.5.post0 tblib==3.0.0 threadpoolctl==3.6.0 tifffile==2025.3.13 toolz==1.0.0 tornado==6.4.2 tox==4.24.2 types-PyYAML==6.0.12.20241230 typing_extensions==4.12.2 tzdata==2025.2 urllib3==1.26.20 virtualenv==20.29.3 wrapt==1.17.2 xarray==2024.7.0 xarray-dataclasses==1.9.1 xarray-datatree==0.0.15 xarray-schema==0.0.3 xarray-spatial==0.4.0 yarl==1.18.3 zarr==2.18.4 zict==3.0.0
Hi, unfortunately the most recent versions of dask are not supported because of a non-backward compatible change that was introduced in dask that is still not addressed. This is why we have the constraint <=2024.11.2 for dask in pyproject.toml.
Please find more details here https://github.com/scverse/spatialdata/issues/860.