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

failure to import spatialdata_io #263

Open
Yijia-Jiang opened this issue Jan 14, 2025 · 1 comment
Open

failure to import spatialdata_io #263

Yijia-Jiang opened this issue Jan 14, 2025 · 1 comment

Comments

@Yijia-Jiang
Copy link

Hello, I am running one of the tutorials and I have installed both spatialdata and spatialdata_io packages, but there is an error importing spatialdata_io. Could you help? Thank you very much!

ImportError Traceback (most recent call last)
Cell In[9], line 2
1 import spatialdata as sd
----> 2 from spatialdata_io import xenium
4 import matplotlib.pyplot as plt
5 import seaborn as sns

File /opt/anaconda3/lib/python3.12/site-packages/spatialdata_io/init.py:14
12 from spatialdata_io.readers.visium import visium
13 from spatialdata_io.readers.visium_hd import visium_hd
---> 14 from spatialdata_io.readers.xenium import (
15 xenium,
16 xenium_aligned_image,
17 xenium_explorer_selection,
18 )
20 all = [
21 "curio",
22 "seqfish",
(...)
34 "visium_hd",
35 ]
37 version = version("spatialdata-io")

File /opt/anaconda3/lib/python3.12/site-packages/spatialdata_io/readers/xenium.py:40
32 from spatialdata.models import (
33 Image2DModel,
34 Labels2DModel,
(...)
37 TableModel,
38 )
39 from spatialdata.transformations.transformations import Affine, Identity, Scale
---> 40 from xarray import DataArray, DataTree
42 from spatialdata_io._constants._constants import XeniumKeys
43 from spatialdata_io._docs import inject_docs

ImportError: cannot import name 'DataTree' from 'xarray' (/opt/anaconda3/lib/python3.12/site-packages/xarray/init.py)

@LucaMarconato
Copy link
Member

Hi, the datatree library has been deprecated and now moved within the xarray library. Please install the latest version of xarray via pip or conda.

In the next days we will be making a release that will add a lower bound for the xarray library and drop the datatree dependency.

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

2 participants