Bokeh 2.4- issue rendering ipywidgets

Trying to run the I got the following error:

  File "/home/epinux/.local/lib/python3.9/site-packages/ipywidgets_bokeh/", line 67, in send
  File "/home/epinux/.local/lib/python3.9/site-packages/ipywidgets_bokeh/", line 83, in _trigger_change
AttributeError: 'Document' object has no attribute '_trigger_on_change'

full log:

The same code works running bokeh 2.3.2, I tried to upgrade [ipywidgets, ipywidgets_bokeh] to the latest releases, but the error persists.

Thanks for any help!

1 Like

@epifanio This likely indicates that the ipywidgets extension package will need some update to be compatible with Bokeh >= 2.4. Please open a GitHub Issue.

1 Like

I’ve finally made the updates and hopefully we’ll have a release in the next few days.

1 Like

Thank you @Philipp_Rudiger , I have been testing the new release - the IPywidgets are now rendering inside a bokeh server app but I can’t manage to link together multiple widgets.
I opened an issue here:
The slider is supposed to update the mapcanvas zoom level, but seem the interaction provided by jslink is lost (the same example code was working using previous release of bokeh+ipywidgets)

from ipywidgets_bokeh import IPyWidget
import ipywidgets as widgets

from bokeh.layouts import row
from bokeh.plotting import curdoc
from ipyleaflet import Map, basemaps
from ipywidgets import jslink

m = Map(center=(46.01, 6.16), zoom=12, basemap=basemaps.Stamen.Terrain)
zoom_slider = widgets.IntSlider(description='Zoom level:', min=0, max=15, value=7)
jslink((zoom_slider, 'value'), (m, 'zoom'))

slider_wrapper = IPyWidget(widget=zoom_slider, width=600, height=400)
map_wrapper = IPyWidget(widget=m, width=600, height=400)

doc = curdoc()
doc.add_root(row(slider_wrapper, map_wrapper))