Hello,
I updated Bokeh from 0.12.13 to 0.12.15 hoping it would make it work better with jupyterlab.
However, that seems to have broken something, and now my interactive widgets don’t work anymore.
This is the error I get with my test code:
data = {‘group’:[‘yes’, ‘no’, ‘yes’, ‘yes’],‘Age’:[1,2,3,4]}
from bokeh.models import ColumnDataSource as cds
my_source = cds(data)
from ipywidgets import interact
import numpy as np
from bokeh.io import push_notebook, show, output_notebook
from bokeh.plotting import figure
from bokeh.models import BoxAnnotation, Label, Span, Band
from bokeh.palettes import Spectral6
from bokeh.transform import factor_cmap
output_notebook()
p = figure()
p = figure(x_range = (0,5), plot_height = 450, plot_width = 950, y_range = (0,1.2),
tools = ‘xwheel_zoom, xpan, reset, save’ )
r = p.vbar(x = ‘Age’, top = 1, alpha = 1, width = 0.1, legend = ‘group’, source = my_source,
color = factor_cmap(‘group’, palette = Spectral6,
factors = np.unique(my_source.data[‘group’])))
pspan = Span(location=2, dimension=‘height’, line_color=‘blue’, line_width=3, line_dash=‘dashed’)
p.add_layout(pspan)
handle = show(p, notebook_handle=True)
def update_span(right_limit):
pspan.location = right_limit
push_notebook(handle = handle)
interact(update_span, right_limit=wdg.FloatSlider(value = 2, min = 0, max = 5,
step = 0.1, layout = wdg.Layout(width = ‘950px’)))
``
In the past this gave me a figure with a slider that I could move left and right. Now all I get is this error:
···
AttributeError Traceback (most recent call last)
~/anaconda2/envs/py36/lib/python3.6/site-packages/ipywidgets/widgets/interaction.py in update(self, *args)
248 value = widget.get_interact_value()
249 self.kwargs[widget._kwarg] = value
→ 250 self.result = self.f(**self.kwargs)
251 show_inline_matplotlib_plots()
252 if self.auto_display and self.result is not None:
in update_span(right_limit)
34 def update_span(right_limit):
35 pspan.location = right_limit
—> 36 push_notebook(handle = handle)
37
38 interact(update_span, right_limit=wdg.FloatSlider(value = 2, min = 0, max = 5,
~/anaconda2/envs/py36/lib/python3.6/site-packages/bokeh/util/api.py in wrapper(*args, **kw)
188 @wraps(obj)
189 def wrapper(*args, **kw):
→ 190 return obj(*args, **kw)
191
192 wrapper.bkversion = version
~/anaconda2/envs/py36/lib/python3.6/site-packages/bokeh/io/notebook.py in push_notebook(document, state, handle)
231
232 ‘’’
→ 233 from …protocol import Protocol
234
235 if state is None:
~/anaconda2/envs/py36/lib/python3.6/site-packages/bokeh/protocol/init.py in ()
10 from tornado.escape import json_decode
11
—> 12 from . import messages
13 from . import versions
14 from .exceptions import ProtocolError
~/anaconda2/envs/py36/lib/python3.6/site-packages/bokeh/protocol/messages/init.py in ()
34 return cls
35
—> 36 from .ack import *
37 from .event import *
38 from .ok import *
~/anaconda2/envs/py36/lib/python3.6/site-packages/bokeh/protocol/messages/ack.py in ()
4 log = logging.getLogger(name)
5
----> 6 from …message import Message
7 from . import register
8
~/anaconda2/envs/py36/lib/python3.6/site-packages/bokeh/protocol/message.py in ()
43 from tornado import gen
44
—> 45 import bokeh.util.serialization as bkserial
46
47 from .exceptions import MessageError, ProtocolError
AttributeError: module ‘bokeh’ has no attribute ‘util’
Out[34]:
``
Python 3.6 under CentOS