David Brochart
David Brochart

Reputation: 885

Jupyter notebook "Run All" prevents BokehJS from being successfully loaded

If I try to "Run All" cells in a Jupyter notebook, with output_notebook() in the first cell and an attempt to show a figure in a cell below, I get the following error message:

/remote/vgrnd5/davidbr/soft/miniconda3/lib/python3.5/site-packages/bokeh/io.py:350: UserWarning:

BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this may be due to a slow or bad network connection. Possible fixes:

  • ALWAYS run output_notebook() in a cell BY ITSELF, AT THE TOP, with no other code
  • re-rerun output_notebook() to attempt to load from CDN again, or
  • use INLINE resources instead, as so:

    from bokeh.resources import INLINE output_notebook(resources=INLINE)

    warnings.warn(_NB_LOAD_WARNING)

BokehJS has been successfully loaded though (from what I see in the output of the first cell), but it looks like it has not been registered somehow, because if I run the first cell and then "Run All Bellow", then it works fine. None of the tricks of the error message work.

Upvotes: 1

Views: 615

Answers (1)

bigreddot
bigreddot

Reputation: 34568

UPDATE: this issue has been resolved and the fix will be in 0.12.2

Evidently the behavior of the Notebook when "run all" is used is to queue up all the cell executions first, before the async outputs happen. The causes the warning to trigger spuriously. None of the core devs use "run all" with any regularity, and this specific queuing behavior was unknown. You can follow this issue for updates:

https://github.com/bokeh/bokeh/issues/4987

In particular, as an immediate workaround, there is this :

enter image description here

Upvotes: 3

Related Questions