question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Plots missing after tab refresh in jupyterlab 0.33

See original GitHub issue
  1. Install bokeh 0.12.16 or 0.13.0, jupyterlab_bokeh 0.6, and jupyterlab 0.33.
  2. Run the following in a notebook cell and see the plot show up as expected.
from bokeh.io import push_notebook, show, output_notebook
from bokeh.layouts import row
from bokeh.plotting import figure
output_notebook()

opts = dict(plot_width=250, plot_height=250, min_border=0)

p1 = figure(**opts)
r1 = p1.circle([1,2,3], [4,5,6], size=20)

p2 = figure(**opts)
r2 = p2.circle([1,2,3], [4,5,6], size=20)

# get a handle to update the shown cell with
t = show(row(p1, p2), notebook_handle=True)
  1. Refresh the browser tab.
  2. When Lab reloads, the plots are missing.
  3. Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing shows in the JS console instead.

The plots did reappear properly after refresh in lab 0.32 with jupyterlab_bokeh 0.5.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
canavandlcommented, Oct 27, 2018

@parente a work-around is to use

from bokeh.plotting import output_notebook, figure, show

output_notebook(hide_banner=True)

which will load BokehJS without checking for the notebook content being reading, so that plots will render correctly on reloading.

2reactions
canavandlcommented, Oct 27, 2018

Thanks for the quality report @parente


Upon further investigation, it appears that the issue is the ```bokeh.io.output_notebook``` call embeds some JS in the notebook as part of a mime bundle. When the page is reloaded, this JS is evaled before the notebook is rendered, so the BokehJS loading is stopped here: https://github.com/bokeh/bokeh/blob/13baccbb2835f7d5831c22b5cf68214e89c02618/bokeh/core/_templates/autoload_js.js#L79

Read more comments on GitHub >

github_iconTop Results From Across the Web

Plots not showing in Jupyter notebook - python - Stack Overflow
If you are working with a Jupyter Notebook then you can add the following line to the top cell where you call all...
Read more >
JupyterLab Changelog — JupyterLab 3.6.0b0 documentation
Update the tutorial to reflect the changes in the latest cookiecutter… ... Handle missing preferredPath from the page config #12521 (@jtpio) ...
Read more >
Using with Jupyter — Bokeh 2.4.3 Documentation
To display Bokeh plots inline in a classic Jupyter notebook, ... After installing JupyterLab, you can use either pip or conda to install...
Read more >
Solve problems with Jupyter Notebooks - coursera.support
If your Jupyter Notebook files have disappeared, it means the course staff published a new version of a given notebook to fix problems...
Read more >
Troubleshooting Vertex AI Workbench - Google Cloud
Refresh the JupyterLab browser page. Any unsaved cell output will not persist, so you must run those cells again to regenerate the output....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found