CSOgroup / cellcharter

A Python package for the identification, characterization and comparison of spatial clusters from spatial -omics data.
https://cellcharter.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
69 stars 2 forks source link

Installation of cellcharter report import error from `spatialdata._core.data_extent` #23

Closed Jieran-S closed 5 months ago

Jieran-S commented 5 months ago

Report

Hi,

After successfully install the package, I cannot import the package to my workspace. Whenever I tried to import cellcharter, the following error message returns:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[20], line 1
----> 1 import cellcharter as cc

File ~/conda_envs/cellcharter_env/lib/python3.10/site-packages/cellcharter/__init__.py:3
      1 from importlib.metadata import version
----> 3 from . import datasets, gr, pl, tl
      5 __all__ = ["gr", "pl", "tl", "datasets"]
      7 __version__ = version("cellcharter")

File ~/conda_envs/cellcharter_env/lib/python3.10/site-packages/cellcharter/pl/__init__.py:4
      2 from ._group import enrichment, proportion
      3 from ._nhood import diff_nhood_enrichment, nhood_enrichment
----> 4 from ._shape import plot_boundaries, plot_shape_metrics

File ~/conda_envs/cellcharter_env/lib/python3.10/site-packages/cellcharter/pl/_shape.py:15
     13 from anndata import AnnData
     14 from scipy.stats import ttest_ind
---> 15 from spatialdata_plot.pl.utils import _get_colors_for_categorical_obs
     17 from ._utils import adjust_box_widths
     20 def plot_boundaries(
     21     adata: AnnData,
     22     sample: str,
   (...)
     26     show_cells: bool = True,
     27 ) -> None:

File ~/conda_envs/cellcharter_env/lib/python3.10/site-packages/spatialdata_plot/__init__.py:3
      1 from importlib.metadata import version
----> 3 from . import pl, pp
      5 __all__ = ["pl", "pp"]
      7 __version__ = version("spatialdata-plot")

File ~/conda_envs/cellcharter_env/lib/python3.10/site-packages/spatialdata_plot/pl/__init__.py:1
----> 1 from .basic import PlotAccessor
      3 __all__ = [
      4     "PlotAccessor",
      5 ]

File ~/conda_envs/cellcharter_env/lib/python3.10/site-packages/spatialdata_plot/pl/basic.py:22
     20 from pandas.api.types import is_categorical_dtype
     21 from spatial_image import SpatialImage
---> 22 from spatialdata._core.data_extent import get_extent
     23 from spatialdata._core.query.relational_query import _locate_value
     24 from spatialdata.transformations.operations import get_transformation

ImportError: cannot import name 'get_extent' from 'spatialdata._core.data_extent' (~/conda_envs/cellcharter_env/lib/python3.10/site-packages/spatialdata/_core/data_extent.py)

My environment is as shown below:

Version information

name: cellcharter_env channels:

Jieran-S commented 5 months ago

Update: After I changed spatialdata from 0.0.12 to 0.0.15 the error disappeared, would it be a version conflict of some sort?

marcovarrone commented 5 months ago

Same as #24

Working on it!