You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The boilerplate example in documentation fails to synchronize traitlets on the most recent install of IPywidgets in the Classic Notebook.
It is unclear to me wether or not this is caused by external dependencies, but the following downgrade of several modules (unsure wether or not they are relevant) fixes the problem:
make sure to use ES6 classes. I'm surprised your code actually runs, I had to do this:
%%javascriptrequire.undef('mywidget')// force reloading when executing cell twicedefine('mywidget',['@jupyter-widgets/base'],function(widgets){classMyWidgetViewextendswidgets.DOMWidgetView{render(){console.log("render");super.render();this._count_changed();this.listenTo(this.model,'change:count',this._count_changed,this);}_count_changed(){varold_value=this.model.previous('count');varnew_value=this.model.get('count');this.el.textContent=String(old_value)+' -> '+String(new_value);}};return{MyWidgetView: MyWidgetView}});
Also, please downgrade ipykernel to < 6.18, or wait for ipython/ipykernel#1061 to be released.
I'm having a similar problem, I had a code that used to run fine using ipywidgets 7.7, but now it won't work with ipywidgets 8. I see that the code was using the same structure as OP's code (using var MyWidgetView = widgets.DOMWidgetView.extend instead of class). However, even if I try to make the changes proposed by @maartenbreddels, I'm still unable to create a view (console error is: TypeError: Class constructor O cannot be invoked without 'new'). Any insights on this error? Thanks.
Description
The boilerplate example in documentation fails to synchronize traitlets on the most recent install of IPywidgets in the Classic Notebook.
It is unclear to me wether or not this is caused by external dependencies, but the following downgrade of several modules (unsure wether or not they are relevant) fixes the problem:
!pip3 install flatbuffers==22.10.26 google-auth==2.13.0 imageio==2.22.2 importlib-metadata==5.1.0 ipykernel==6.17.1 ipywidgets==8.0.2 jupyter-server==1.23.3 nbformat==5.7.0 prompt-toolkit==3.0.32 protobuf==4.21.9 SQLAlchemy==1.4.44 traitlets==5.6.0 widgetsnbextension==4.0.3
I first encountered this problem on December 19th 2022, and managed to narrow it down to the above modules by comparing to a working installation.
Reproduce
On a recent install of IPywidgets in a classic Notebook, run:
In the next cell:
Finally:
Expected behaviour
Javascript console should print "render" and cell output area should show "0 -> 2".
Context
The text was updated successfully, but these errors were encountered: