InsightSoftwareConsortium / itkwidgets

An elegant Python interface for visualization on the web platform to interactively generate insights into multidimensional images, point sets, and geometry.
https://itkwidgets.readthedocs.io/
Apache License 2.0
579 stars 83 forks source link

Cant import Viewer #621

Closed gattia closed 1 year ago

gattia commented 1 year ago

Seems to be the same problem as https://github.com/InsightSoftwareConsortium/itkwidgets/issues/615 However, updating to the latest alpha just produces other errors:

File "/dataNAS/people/aagatti/miniconda/envs/generative_anatomy/lib/python3.9/site-packages/pyfocusr/focusr.py", line 5, in <module>
    from itkwidgets import Viewer
  File "/dataNAS/people/aagatti/miniconda/envs/generative_anatomy/lib/python3.9/site-packages/itkwidgets/__init__.py", line 4, in <module>
    register_default_codecs()
  File "/dataNAS/people/aagatti/miniconda/envs/generative_anatomy/lib/python3.9/site-packages/imjoy_rpc/utils.py", line 347, in register_default_codecs
    api.registerCodec(
  File "/dataNAS/people/aagatti/miniconda/envs/generative_anatomy/lib/python3.9/site-packages/imjoy_rpc/werkzeug/local.py", line 349, in __getattr__
    return getattr(self._get_current_object(), name)
  File "/dataNAS/people/aagatti/miniconda/envs/generative_anatomy/lib/python3.9/site-packages/imjoy_rpc/__init__.py", line 48, in __getattr__
    return _rpc_context.api[attr]
KeyError: 'registerCodec'

I tried reverting back to an old itkwidgets (0.32.5) and that failed too. I had github actions running tests 2 weeks ago that are now failing.

2 weeks ago: https://github.com/gattia/pyfocusr/actions/runs/4152699476/jobs/7183836252 Today: https://github.com/gattia/pyfocusr/actions/runs/4267422214/jobs/7429010153

Looks like ipydatawidgets released a new version last week and it has broken something in the itkwidgets pipeline... https://pypi.org/project/ipydatawidgets/#history

if install ipywidgets<4.3.3 things work. I will report to ipywidgets too.

thewtex commented 1 year ago

@gattia thanks for the information! If ipydatawidgets is downgraded to 4.3.2, does the issue still occur?

gattia commented 1 year ago

Yep, 4.3.2 works as expected.

Happy to close if this is considered a problem with ipydatawidgets. But might be good to change requirements to <4.3.3 at least for now.

thewtex commented 1 year ago

@gattia :+1: adding constraint in #624.

thewtex commented 1 year ago

Pin released in 0.32.6