Open nvaytet opened 2 years ago
Mmh I'm wondering if something has changed in JupyterLab recently that causes this. Would you be able to try to downgrade JupyterLab?
Which version should I try?
Sorry I didn't mean to close this issue 😕 maybe 3.0?
Looks like I'm not the only one closing issues unintentionally https://twitter.com/choldgraf/status/1542169522282860550?s=20&t=7WHeO5lmM8dD62HwB5qHsg
I am still getting the "Model not found" error in Jupyterlab=3.0.18
272.3fcd6d7045eecfb56da6.js:1 Failed to fetch ipywidgets through the "jupyter.widget.control" comm channel, fallback to fetching individual model state. Reason: Control comm was closed too early
(anonymous) @ 272.3fcd6d7045eecfb56da6.js:1
(anonymous) @ 272.3fcd6d7045eecfb56da6.js:1
(anonymous) @ 272.3fcd6d7045eecfb56da6.js:1
a @ 272.3fcd6d7045eecfb56da6.js:1
Promise.then (async)
l @ 272.3fcd6d7045eecfb56da6.js:1
s @ 272.3fcd6d7045eecfb56da6.js:1
Promise.then (async)
l @ 272.3fcd6d7045eecfb56da6.js:1
(anonymous) @ 272.3fcd6d7045eecfb56da6.js:1
D @ 272.3fcd6d7045eecfb56da6.js:1
e._loadFromKernel @ 272.3fcd6d7045eecfb56da6.js:1
_loadFromKernel @ 523.66fca84c7924f6f7676d.js:1
await in _loadFromKernel (async)
restoreWidgets @ 523.66fca84c7924f6f7676d.js:1
x @ 523.66fca84c7924f6f7676d.js:1
L @ 523.66fca84c7924f6f7676d.js:1
(anonymous) @ 523.66fca84c7924f6f7676d.js:1
m @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
l @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
e.emit @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
(anonymous) @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
m @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
l @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
e.emit @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
add @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
await in add (async)
add @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
add @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
(anonymous) @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
m @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
l @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
e.emit @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
createNew @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
createWidget @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
_createOrOpenDocument @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
open @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
openOrReveal @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
_handleOpen @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
_evtDblClick @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
handleEvent @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
523.66fca84c7924f6f7676d.js:1 Error: widget model not found
at x.get_model (523.66fca84c7924f6f7676d.js:1:6292)
at u.renderModel (523.66fca84c7924f6f7676d.js:1:972)
renderModel @ 523.66fca84c7924f6f7676d.js:1
await in renderModel (async)
_rerender @ 523.66fca84c7924f6f7676d.js:1
m @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
l @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
e.emit @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
restoreWidgets @ 523.66fca84c7924f6f7676d.js:1
await in restoreWidgets (async)
x @ 523.66fca84c7924f6f7676d.js:1
L @ 523.66fca84c7924f6f7676d.js:1
(anonymous) @ 523.66fca84c7924f6f7676d.js:1
m @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
l @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
e.emit @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
(anonymous) @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
m @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
l @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
e.emit @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
add @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
await in add (async)
add @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
add @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
(anonymous) @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
m @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
l @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
e.emit @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
createNew @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
createWidget @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
_createOrOpenDocument @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
open @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
openOrReveal @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
_handleOpen @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
_evtDblClick @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
handleEvent @ jlab_core.8e0f8627d52a54fc21fe.js?v=8e0f8627d52a54fc21fe:2
Ah, version 3.0.0
works!
Another question: is it at all possible to obtain the same behaviour if the figure is placed inside another (e.g. VBox
) widget?
Thanks!
Ah, version 3.0.0 works!
Interesting! So something has changed between 3.0.0 and 3.0.18 that prevents it from displaying the image repr...
Another question: is it at all possible to obtain the same behaviour if the figure is placed inside another (e.g. VBox) widget?
This might be difficult, if the VBox cannot be displayed then we cannot do much about it. Also the VBox embeds the widget representation of the plot, not the image one.
What's interesting is:
I am guessing the png repr is correctly being saved by 3.0.0 (I don't know exactly which version broke between 3.0.0 and 3.0.18 yet), and then it can be loaded by later versions.
So this would mean that versions 3.0.18 and higher are failing to save the png rather than load it?
I can confirm that downgrading (mamba install jupyterlab=3.0.0
) also fixes this issue for me.
Can confirm that jupyterlab 3.0.0 does work and that jupyterlab 3.5.2 does not work. Also: the problem seems to be in saving the notebook. A simple notebook saved with 3.0.0 opens with a static image in 3.5.2.
I can confirm @davidfokkema. That 3.0.0 works and 3.5.2 not. Moreover in our case we use widgets with asynchronous calls. And this problem leads to widgets disappearing from the notebook approximately after one minute idle.
Just tested this with 3.5.0 and it works.
I get "Error displaying widget: model not found" with the following env (and jupyterlab 3.6.1):
$ mamba list jupyterlab
# packages in environment at /Users/jklymak/mambaforge/envs/LP22a:
#
# Name Version Build Channel
jupyterlab 3.5.0 pyhd8ed1ab_0 conda-forge
jupyterlab_pygments 0.2.2 pyhd8ed1ab_0 conda-forge
jupyterlab_server 2.19.0 pyhd8ed1ab_0 conda-forge
jupyterlab_widgets 3.0.5 pyhd8ed1ab_0 conda-forge
(LP22a)
# jklymak @ quadra in ~/Dropbox/LP22a [16:05:37]
$ mamba list ipympl
# packages in environment at /Users/jklymak/mambaforge/envs/LP22a:
#
# Name Version Build Channel
ipympl 0.9.3 pyhd8ed1ab_0 conda-forge
(LP22a)
jupyterlab 3.0.0 works though.
Not working in the jupyterlab 3.6.4 either.
This is a bit old, but I just ran into this with a fresh installation of ipympl (0.9.4) & jupyter-lab (4.2.1).
However there is now a jupyter-lab menu Settings
->Save Widget State Automatically
which resolved this. Now the plots (the embedded png) are correctly displayed after re-opening a shutdown'd notebook. And it's also correctly displayed using nbsphinx
as well.
Hi, unfortunately, I am still seeing this error after re-opening the notebook.
The console log from Chrome:
Versions:
Thanks for any help!
Originally posted by @nvaytet in https://github.com/matplotlib/ipympl/issues/343#issuecomment-1170066433