Skip to content
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

NotImplementedError: The legacy implementation is no longer supported - trying to install and import squidpy #937

Open
Mdack1 opened this issue Jan 20, 2025 · 2 comments

Comments

@Mdack1
Copy link

Mdack1 commented Jan 20, 2025


NotImplementedError Traceback (most recent call last)
in <cell line: 0>()
----> 1 import squidpy as sq

5 frames
/usr/local/lib/python3.11/dist-packages/squidpy/init.py in
4 from importlib.metadata import PackageMetadata
5
----> 6 from squidpy import datasets, gr, im, pl, read, tl
7
8 try:

/usr/local/lib/python3.11/dist-packages/squidpy/gr/init.py in
3 from future import annotations
4
----> 5 from squidpy.gr._build import mask_graph, spatial_neighbors
6 from squidpy.gr._ligrec import ligrec
7 from squidpy.gr._nhood import centrality_scores, interaction_matrix, nhood_enrichment

/usr/local/lib/python3.11/dist-packages/squidpy/gr/_build.py in
28 from sklearn.metrics.pairwise import cosine_similarity, euclidean_distances
29 from sklearn.neighbors import NearestNeighbors
---> 30 from spatialdata import SpatialData
31 from spatialdata._core.centroids import get_centroids
32 from spatialdata._core.query.relational_query import (

/usr/local/lib/python3.11/dist-packages/spatialdata/init.py in
4
5 dask.config.set({"dataframe.query-planning": False})
----> 6 import dask.dataframe as dd
7
8 # Setting dataframe.query-planning to False is effective only if run before dask.dataframe is initialized. In

/usr/local/lib/python3.11/dist-packages/dask/dataframe/init.py in
12
13
---> 14 _dask_expr_enabled()
15
16

/usr/local/lib/python3.11/dist-packages/dask/dataframe/init.py in _dask_expr_enabled()
7 use_dask_expr = dask.config.get("dataframe.query-planning")
8 if use_dask_expr is False:
----> 9 raise NotImplementedError("The legacy implementation is no longer supported")
10
11 return True

NotImplementedError: The legacy implementation is no longer supported

@maltekuehl
Copy link

I solved it for now by installing dask==2024.11.2. It seems that squidpy still uses a legacy Dask DataFrame and has not fixed versions to include only compatible dask implementations.

@mmohenska
Copy link

mmohenska commented Jan 29, 2025

I had to take a few more steps because I had dependency issues, but this worked for me (I tried in python=3.11.11):

pip install "dask[dataframe]==2024.11.2"
pip install "spatialdata>=0.2.5" ome-zarr>=0.8.4
pip install squidpy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants