Skip to content

import view causes ModuleNotFoundError: No module named 'zarr.storage' #763

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

Open
kirbyju opened this issue Sep 24, 2024 · 4 comments
Open

Comments

@kirbyju
Copy link

kirbyju commented Sep 24, 2024

Please see kirbyju/TCIA_Notebooks#30 for details. Note that I found a workaround (reinstalling zarr packages), but plan to keep the issue open there until the root cause is fixed in itkwidgets.

Thanks,
Justin

@thewtex
Copy link
Member

thewtex commented Oct 7, 2024

xref: kirbyju/TCIA_Notebooks#31

@fedorov
Copy link
Member

fedorov commented Feb 3, 2025

@thewtex latest zarr package is no longer a prerelease but (presumably) stable 3.0.2 (see https://github.com/zarr-developers/zarr-python/releases/tag/v3.0.2).

Import of itkwidgets with the latest zarr fails with the error below. Downgrade to zarr 2.18.4 fixes the issue.

AttributeError                            Traceback (most recent call last)
<ipython-input-1-156ffb6e299b> in <cell line: 0>()
      1 import itk
----> 2 from itkwidgets import view
      3 # Pydicom-Seg is a layer on top of pydicom that handles DICOM SEG objects.
      4 import pydicom
      5 import pydicom_seg

1 frames
/usr/local/lib/python3.11/dist-packages/itkwidgets/imjoy.py in register_itkwasm_imjoy_codecs()
     47 
     48     api.registerCodec({'name': 'itkwasm-image', 'type': itkwasm.Image, 'encoder': encode_itkwasm_image})
---> 49     api.registerCodec({'name': 'zarr-store', 'type': zarr.storage.BaseStore, 'encoder': encode_zarr_store})
     50 
     51 

AttributeError: module 'zarr.storage' has no attribute 'BaseStore'

@thewtex
Copy link
Member

thewtex commented Feb 7, 2025

@fedorov @kirbyju 👍 yes, thanks for the ping 🙏 . I release itkwidgets 1.0a55 that includes this zarr version constraint until we support Zarr 3.

@fedorov
Copy link
Member

fedorov commented Feb 27, 2025

@thewtex with 1.0a55, viewer does not work at all in Colab. I will submit a separate issue.

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