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

comm package throws NotImplementedError: Cannot #3729

Closed
pllim opened this issue Mar 21, 2023 · 4 comments · Fixed by ipython/comm#13
Closed

comm package throws NotImplementedError: Cannot #3729

pllim opened this issue Mar 21, 2023 · 4 comments · Fixed by ipython/comm#13

Comments

@pllim
Copy link
Contributor

pllim commented Mar 21, 2023

Example log: https://github.com/spacetelescope/jdaviz/actions/runs/4481154442/jobs/7877457906?pr=2105

All the ipy* package versions:

comm==0.1.2
...
ipydatawidgets==4.3.3
ipygoldenlayout==0.4.0
ipykernel==6.22.0
ipympl==0.9.3
ipypopout==1.0.0
ipysplitpanes==0.2.0
ipython==8.11.0
ipython-genutils==0.2.0
ipyvolume==0.6.1
ipyvue==1.9.0
ipyvuetify==1.8.5
ipywebrtc==0.6.0
ipywidgets==8.0.5

Traceback:

jdaviz/app.py:9: in <module>
    import ipyvue
ipyvue/__init__.py:2: in <module>
    from .Html import Html
ipyvue/Html.py:2: in <module>
    from .VueWidget import VueWidget
ipyvue/VueWidget.py:8: in <module>
    from .ForceLoad import force_load_instance
ipyvue/ForceLoad.py:12: in <module>
    force_load_instance = ForceLoad()
ipywidgets/widgets/widget.py:504: in __init__
    self.open()
ipywidgets/widgets/widget.py:517: in open
    state, buffer_paths, buffers = _remove_buffers(self.get_state())
ipywidgets/widgets/widget.py:615: in get_state
    value = to_json(getattr(self, k), self)
traitlets/traitlets.py:703: in __get__
    return self.get(obj, cls)
traitlets/traitlets.py:659: in get
    default = obj.trait_defaults(self.name)
traitlets/traitlets.py:1872: in trait_defaults
    return self._get_trait_default_generator(names[0])(self)
traitlets/traitlets.py:627: in default
    return self.make_dynamic_default()
ipywidgets/widgets/trait_types.py:365: in make_dynamic_default
    return self.klass(*(self.default_args or ()),
ipywidgets/widgets/widget_layout.py:86: in __init__
    super().__init__(**kwargs)
ipywidgets/widgets/widget.py:504: in __init__
    self.open()
ipywidgets/widgets/widget.py:535: in open
    self.comm = create_comm(**args)
comm/__init__.py:27: in _create_comm
    raise NotImplementedError("Cannot ")
E   NotImplementedError: Cannot

@maartenbreddels , do you know what is going on here? Thanks!

@martinRenou
Copy link
Member

We've been discussing exactly this this morning with @maartenbreddels.

The reason you are seing this is because you are not running under an ipykernel session, so ipykernel has not registered its comm implementation.

For now, you may fix it by doing import ipykernel.ipkernel in your test session, which has a byproduct of registering the ipykernel comm implementation.

We will want to improve this situation in the core comm module or/and in ipywidgets.

@pllim
Copy link
Contributor Author

pllim commented Mar 21, 2023

I put that import in conftest.py but didn't seem to help. Where should I import it for it to work? See spacetelescope/jdaviz#2105

@giswqs
Copy link
Contributor

giswqs commented Mar 22, 2023

I just ran into the same error.

@martinRenou
Copy link
Member

This should now be fixed using the latest comm package

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

Successfully merging a pull request may close this issue.

3 participants