jupyter_bokeh: Cells which create bokeh plots do not get saved

I’ve encountered an issue where all cells which produce a bokeh plot in Jupyter Lab do not get saved.

Versions

$ jupyter labextension list
JupyterLab v0.31.8
Known labextensions:
   app dir: /opt/conda/share/jupyter/lab
@jupyter-widgets/jupyterlab-manager
        @jupyter-widgets/jupyterlab-manager v0.33.2  enabled  OK
@jupyterlab/hub-extension
        @jupyterlab/hub-extension v0.8.1  enabled  OK
jupyterlab_bokeh
        jupyterlab_bokeh v0.4.0  enabled  OK

Reproducing

  • Create a new notebook
  • Create a cell with the following code
from bokeh.io import show, output_notebook
from bokeh.models import ColumnDataSource
from bokeh.plotting import figure
from bokeh.sampledata.commits import data
from bokeh.transform import jitter

output_notebook()

DAYS = ['Sun', 'Sat', 'Fri', 'Thu', 'Wed', 'Tue', 'Mon']

source = ColumnDataSource(data)

p = figure(plot_width=800, plot_height=300, y_range=DAYS, x_axis_type='datetime',
           title="Commits by Time of Day (US/Central) 2012-2016")

p.circle(x='time', y=jitter('day', width=0.6, range=p.y_range),  source=source, alpha=0.3)

p.xaxis[0].formatter.days = ['%Hh']
p.x_range.range_padding = 0
p.ygrid.grid_line_color = None

show(p)
  • Save the notebook
  • Restart Jupyter Lab
  • Open the notebook
  • The cell is missing

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 5
  • Comments: 19 (6 by maintainers)

Most upvoted comments

@jacobtomlinson @tjcrone

This issue was resolved in #34 and a new jupyterlab_bokeh=0.4.1 lab extension has been published. Please open a new issue if there are still problems.

Further investigation shows that if I then import and run output_notebook() again in a new cell and then close and reopen the notebook the missing cell reappears.

I’m still seeing this issue with every restart of any bokeh plot using “output_notebook” with the following jupyter lab and lab extensions versions, am I missing any extensions or down reved where there is a more recent version? These are all installed from “jupyter labextension install” in the last month or less:

~> jupyter labextension list
JupyterLab v1.1.4 Known labextensions: app dir: <…>/.pyenv/versions/anaconda3-2019.10/share/jupyter/lab @bokeh/jupyter_bokeh v1.1.1 enabled OK @jupyter-widgets/jupyterlab-manager v1.0.3 enabled OK bqplot v0.5.1 enabled OK jupyterlab-plotly v1.3.0 enabled OK jupyterlab_bokeh v1.0.0 enabled OK plotlywidget v1.3.0 enabled OK qgrid v1.1.1 enabled OK

Any advice, recommendations, is appreciated. Please let me know if additional info is required.

Thanks! -chunkylover

I am also experiencing this. The cells are saved, but if any have bokeh output, those cells are not shown when the notebook is opened. One solution is to clear the outputs, save, and reopen. Also not ideal though.

Versions

jovyan@jupyter-tjcrone:~$ jupyter labextension list
JupyterLab v0.31.12
Known labextensions:
   app dir: /opt/conda/share/jupyter/lab
@jupyter-widgets/jupyterlab-manager
        @jupyter-widgets/jupyterlab-manager v0.34.0  enabled  OK
@jupyterlab/hub-extension
        @jupyterlab/hub-extension v0.8.1  enabled  OK
@pyviz/jupyterlab_holoviews
        @pyviz/jupyterlab_holoviews v0.3.3  enabled  OK
jupyterlab_bokeh
        jupyterlab_bokeh v0.4.0  enabled  OK