ipywidgets
ipywidgets copied to clipboard
ipywidgets cannot render when connected to a kernel of another notebook
I am having issues displaying ipywidgets when two notebooks share the same kernel. The original notebook (which instantiated the kernel) is still able to display widgets. However, if I connect another notebook to the same kernel, the second notebook is unable to display any widgets. Instead, an error message is displayed (see below for details). Oddly enough, the original notebook can still display widgets without any issues.
The issue is somewhat related to #1218 and #1881 although the issues are fairly old, and it sounds as though it should be possible to use ipywidgets when a kernel is shared by multiple frontends.
Is this a known issue, and is there any solution to this?
Steps to reproduce:
- Create
notebook1.ipynband initialize kernel. - Create
notebook2.ipynband initialize kernel. - Change kernel of
notebook2.ipynbto that ofnotebook1.ipynb - Run the following code on
notebook2.ipynb:
from ipywidgets.widgets import Button
Button()
Expected result:
An ipywidget button appears
Actual results
Output shows Error displaying widget: model not found along with the following error message in the console:

System specs:
OS Windows 10 python 3.7 ipython 7.9.0 ipywidgets 7.5.1 jupyter 1.0.0 jupyter-client 5.3.4 jupyter-console 6.0.0 jupyter-core 4.6.1 jupyterlab 1.2.3 jupyterlab-server 1.0.6 NodeJS 12.13.0
$ jupyter labextension list JupyterLab v1.2.3 Known labextensions: app dir: c:\programdata\anaconda3\share\jupyter\lab @jupyter-widgets/jupyterlab-manager v1.1.0 enabled ok @jupyter-widgets/jupyterlab-sidecar v0.4.0 enabled ok bqplot v0.5.1 enabled ok jupyter-matplotlib v0.4.2 enabled ok