Error in import squidpy: cannot import name 'SparseCSCView' from 'anndata._core.views' #928
Open
Description
Description
Hi, I'm trying to use squidpy but when I try to import it returns an error. It seems to search for a function in anndata which I couldn't find. I might just have misunderstood the error, and if that's the case, I apologize. Could you please help me understand or resolve this issue?
Thanks in advance
...
Minimal reproducible example
#the package was downloaded from conda with other packages like sainsc. I'm running the code in this environment on Spyder 6. Anndata version=0.11.1
import squidpy as sq
...
Traceback
ImportError Traceback (most recent call last)
Cell In[18], line 1
----> 1 import squidpy as sq
File ~/anaconda3/envs/sainsc/lib/python3.12/site-packages/squidpy/__init__.py:5
1 from __future__ import annotations
3 from importlib import metadata
----> 5 from squidpy import datasets, gr, im, pl, read, tl
7 try:
8 md = metadata.metadata(__name__)
File ~/anaconda3/envs/sainsc/lib/python3.12/site-packages/squidpy/gr/__init__.py:5
1 """The graph module."""
3 from __future__ import annotations
----> 5 from squidpy.gr._build import spatial_neighbors
6 from squidpy.gr._ligrec import ligrec
7 from squidpy.gr._nhood import centrality_scores, interaction_matrix, nhood_enrichment
File ~/anaconda3/envs/sainsc/lib/python3.12/site-packages/squidpy/gr/_build.py:31
29 from squidpy._docs import d, inject_docs
30 from squidpy._utils import NDArrayA
---> 31 from squidpy.gr._utils import (
32 _assert_categorical_obs,
33 _assert_positive,
34 _assert_spatial_basis,
35 _save_data,
36 )
38 __all__ = ["spatial_neighbors"]
41 @d.dedent
42 @inject_docs(t=Transform, c=CoordType)
43 def spatial_neighbors(
(...)
56 copy: bool = False,
57 ) -> tuple[csr_matrix, csr_matrix] | None:
File ~/anaconda3/envs/sainsc/lib/python3.12/site-packages/squidpy/gr/_utils.py:12
10 import pandas as pd
11 from anndata import AnnData
---> 12 from anndata._core.views import ArrayView, SparseCSCView, SparseCSRView
13 from anndata.utils import make_index_unique
14 from pandas import CategoricalDtype
ImportError: cannot import name 'SparseCSCView' from 'anndata._core.views' (/home/onco-lab/anaconda3/envs/sainsc/lib/python3.12/site-packages/anndata/_core/views.py)
...
Version
Name Version Build Channel
squidpy 1.5.0 pyhd8ed1ab_0 conda-forge
Anndata version=0.11.1
...
Metadata
Assignees
Labels
No labels
Activity