-
Notifications
You must be signed in to change notification settings - Fork 950
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
Widget rendering in JupyterLab4 and JupyterNotebook7 #3823
Comments
FYI, turning this option on saves the widget state when you save the notebook. Turning the option off means that when you save the notebook, the widget state is not saved with the notebook (so notebook files are smaller, for example). However, I just verified your other point:
When I have a notebook with widget state saved, and try to open it in JupyterLab, the widget is not rendered. It should be rendered from the state saved in the notebook file, and I think that is what is happening in notebook 6. |
hi @ibdafna, I'm happy to see that you self-assigned to this issue! I'm curious to understand this bug a bit better: Currently, "Save Widget State Automatically" adds a lot of data like "ewogICJ2ZXJzaW9uIjogMywKICAic291..." into the That can increase the size of the notebook quite a bit (up to a few 100kBs) which is totally fine when there's actual information saved, but would be unnecessary clutter in case that it's just corrupted data that comes from a bug while saving the notebook. So the question: Is this bug related to widget saving, or widget loading? |
As noted in #3758, opening a notebook in NBClassic that was saved in JLab 4/Notebook 7 with automatic saving of widget states properly renders the widget state with the broken connection icons. This suggests the problem is a notebook parsing or internal JLab communications issue and not related to an error in the data saved. |
Since this looks like (it could be) JupyterLab 4 issue, I would suggest opening an issue against https://github.com/jupyterlab/jupyterlab :) |
Still I am facing: Error displaying widget: model not found, with: Is there any update on this? I am quite bothered by this problem, some long running results should be retained in the ipywidgets objects, including Output(). Please help identify the root cause as a group, be it jupyterlab, ipywidgets, ipython, javescript file, or whatever, instead of passing the bucks around. Thanks again. |
@dinohsu1019 I can understand your frustration. python3.11 -m venv .venv && source .venv/bin/activate
pip install notebook==6.5.6 |
Note that #3866 should fix this. |
Really happy this is solved now, thanks everyone for making this possible! |
Thank you for the feedback ❤️ |
Quite agree !!!!!!!!!!!!!!!!!!! |
Today I was investigating how I can store the state of a widget with the latest Jupyter setups.
I wanted to know:
And here is a summary of my findings:
used code:
Key findings from the above chart:
I think making widget rendering possible after a notebook restart in the latest Jupyter environments would be a fantastic improvement. This could impact the widget ecosystem in a very positive way, especially since numerous people in the community have reported similar widget model not found errors:
Widget state not persisted after kernel restart #3758,
ipywidgets not renderering without a kernel #3773,
ipywidgets cannot render when connected to a kernel of another notebook #2628,
Display image even when restarting notebook. #3183,
In JupyterLab 4.02, ipywidgets throws error in console on saving widget state. #3790
https://discourse.jupyter.org/t/widgets-not-rendering-after-the-second-time-a-notebook-is-reopened/10631
https://discourse.jupyter.org/t/error-displaying-widget-model-not-found-geemap/11473
The text was updated successfully, but these errors were encountered: