Jupyter Notebook hangs, doesn't render plots.

I’m running Bokeh in a Jupyter Notebook and occasionally the plots don’t render and the Notebook hangs (doesn’t respond). When I run the code at the bottom of this post (which is from the user guide’s “Quickstart”), and the Notebook hangs, my browser developer tools give me the following error (although I don’t know what it means):

Error: Class c801b400-0643-42af-8e4c-6ac1525e4839 not found in registry
http://localhost:8888/static/notebook/js/main.min.js?v=e9202bfed0abebc099a5baa479dd5ef6
Line 12751

The tutorial in the link below causes failure consistently, when I call the “interact” function.

There doesn’t seem to be a problem if I output to a file, only when I output to the Notebook.

from bokeh.plotting import figure, show, output_notebook, output_file

prepare some data

x = [0.1, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0]
y0 = [i**2 for i in x]
y1 = [10i for i in x]
y2 = [10
(i**2) for i in x]

output_notebook()

create a new plot

p = figure(
tools=“pan,box_zoom,reset,save”,
y_axis_type=“log”, y_range=[0.001, 10**11], title=“log axis example”,
x_axis_label=‘sections’, y_axis_label=‘particles’
)

add some renderers

p.line(x, x, legend=“y=x”)
p.circle(x, x, legend=“y=x”, fill_color=“white”, size=8)
p.line(x, y0, legend=“y=x^2”, line_width=3)
p.line(x, y1, legend=“y=10^x”, line_color=“red”)
p.circle(x, y1, legend=“y=10^x”, fill_color=“red”, line_color=“red”, size=6)
p.line(x, y2, legend=“y=10^x^2”, line_color=“orange”, line_dash=“4 4”)

show the results

show§

``

“bokeh info” returns:
Python version : 2.7.6 (default, Jun 22 2015, 17:58:13)
IPython version : 4.0.0
Bokeh version : 0.11.1
BokehJS static path : /usr/local/lib/python2.7/dist-
packages/bokeh/server/static

···

On Friday, May 20, 2016 at 5:33:30 PM UTC+2, Ólavur Mortensen wrote:

from bokeh.plotting import figure, show, output_notebook, output_file

prepare some data

x = [0.1, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0]
y0 = [i**2 for i in x]
y1 = [10i for i in x]
y2 = [10
(i**2) for i in x]

output_notebook()

create a new plot

p = figure(
tools=“pan,box_zoom,reset,save”,
y_axis_type=“log”, y_range=[0.001, 10**11], title=“log axis example”,
x_axis_label=‘sections’, y_axis_label=‘particles’
)

add some renderers

p.line(x, x, legend=“y=x”)
p.circle(x, x, legend=“y=x”, fill_color=“white”, size=8)
p.line(x, y0, legend=“y=x^2”, line_width=3)
p.line(x, y1, legend=“y=10^x”, line_color=“red”)
p.circle(x, y1, legend=“y=10^x”, fill_color=“red”, line_color=“red”, size=6)
p.line(x, y2, legend=“y=10^x^2”, line_color=“orange”, line_dash=“4 4”)

show the results

show§

``

I’m running Bokeh in a Jupyter Notebook and occasionally the plots don’t render and the Notebook hangs (doesn’t respond). When I run the code at the bottom of this post (which is from the user guide’s “Quickstart”), and the Notebook hangs, my browser developer tools give me the following error (although I don’t know what it means):

Error: Class c801b400-0643-42af-8e4c-6ac1525e4839 not found in registry
http://localhost:8888/static/notebook/js/main.min.js?v=e9202bfed0abebc099a5baa479dd5ef6
Line 12751

The tutorial in the link below causes failure consistently, when I call the “interact” function.
https://github.com/bokeh/bokeh/blob/0.11.1/examples/howto/notebook_comms/Jupyter%20Interactors.ipynb

There doesn’t seem to be a problem if I output to a file, only when I output to the Notebook.

In case anyone reads this, this was covered (sort of) in this post, and moving to Python 3 seems to do the job.

···

On Friday, May 20, 2016 at 5:43:00 PM UTC+2, Ólavur Mortensen wrote:

“bokeh info” returns:
Python version : 2.7.6 (default, Jun 22 2015, 17:58:13)
IPython version : 4.0.0
Bokeh version : 0.11.1
BokehJS static path : /usr/local/lib/python2.7/dist-
packages/bokeh/server/static

On Friday, May 20, 2016 at 5:33:30 PM UTC+2, Ólavur Mortensen wrote:

from bokeh.plotting import figure, show, output_notebook, output_file

prepare some data

x = [0.1, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0]
y0 = [i**2 for i in x]
y1 = [10i for i in x]
y2 = [10
(i**2) for i in x]

output_notebook()

create a new plot

p = figure(
tools=“pan,box_zoom,reset,save”,
y_axis_type=“log”, y_range=[0.001, 10**11], title=“log axis example”,
x_axis_label=‘sections’, y_axis_label=‘particles’
)

add some renderers

p.line(x, x, legend=“y=x”)
p.circle(x, x, legend=“y=x”, fill_color=“white”, size=8)
p.line(x, y0, legend=“y=x^2”, line_width=3)
p.line(x, y1, legend=“y=10^x”, line_color=“red”)
p.circle(x, y1, legend=“y=10^x”, fill_color=“red”, line_color=“red”, size=6)
p.line(x, y2, legend=“y=10^x^2”, line_color=“orange”, line_dash=“4 4”)

show the results

show§

``

I’m running Bokeh in a Jupyter Notebook and occasionally the plots don’t render and the Notebook hangs (doesn’t respond). When I run the code at the bottom of this post (which is from the user guide’s “Quickstart”), and the Notebook hangs, my browser developer tools give me the following error (although I don’t know what it means):

Error: Class c801b400-0643-42af-8e4c-6ac1525e4839 not found in registry
http://localhost:8888/static/notebook/js/main.min.js?v=e9202bfed0abebc099a5baa479dd5ef6
Line 12751

The tutorial in the link below causes failure consistently, when I call the “interact” function.
https://github.com/bokeh/bokeh/blob/0.11.1/examples/howto/notebook_comms/Jupyter%20Interactors.ipynb

There doesn’t seem to be a problem if I output to a file, only when I output to the Notebook.