Bokeh not rendering, stuck on Loading BokehJS [BUG]
See original GitHub issueHi,
Yesterday I had Bokeh version 0.12 or something like that running on windows 10 (so within Anaconda). I decided to upgrade to version 2.0.2 within the notebook using !pip install bokeh --upgrade
and it seems to have been a terrible mistake. Now I cannot even plot the simplest things.
I do the imports as follows and try to plot just a simple line
from bokeh.models import Slider, ColumnDataSource, Button, Panel, Tabs, CategoricalColorMapper, HoverTool, Select
from bokeh.io import push_notebook, output_notebook, reset_output
from bokeh.plotting import figure, show #, output_file
from bokeh.layouts import gridplot, row, column
from bokeh.palettes import Category10
# from bokeh.resources import INLINE
# import bokeh.io
# bokeh.io.output_notebook(INLINE)
from numpy.random import random
import sys
# output_notebook()
output_notebook()#hide_banner=True) #Este comando se necesita para hacer el embedding the los plots!!!!!
This just gives Loading BokehJS ...
and the jupyter cell moves on to the next one but it doesn’t successfully loads Bokeh.
Then, trying to run
p = figure()
p.line(x=[2,4,5,6,7], y=[3,4,5,7,9])
show(p)
does nothing…
As you can tell I have already tried the solution bokeh.io.output_notebook(INLINE)
but it just doesn’t do the trick.
When running !bokeh info
in the jupyter notebook I get:
Python version : 3.7.3 (default, Apr 24 2019, 15:29:51) [MSC v.1915 64 bit (AMD64)]
IPython version : 7.6.1
Tornado version : 6.0.3
Bokeh version : 2.0.2
BokehJS static path : c:\users\cuspi\anaconda3\lib\site-packages\bokeh\server\static
node.js version : (not installed)
npm version : (not installed)```
I have tried this on Chrome, Firefox and Explorer. I do get a couple of errors in the JS console:
```VM40:258 Uncaught TypeError: Bokeh.set_log_level is not a function
at inline_js (eval at append_javascript (outputarea.js:763), <anonymous>:258:13)
at run_inline_js (eval at append_javascript (outputarea.js:763), <anonymous>:271:20)
at eval (eval at append_javascript (outputarea.js:763), <anonymous>:293:7)
at eval (eval at append_javascript (outputarea.js:763), <anonymous>:179:11)
at Array.forEach (<anonymous>)
at run_callbacks (eval at append_javascript (outputarea.js:763), <anonymous>:177:36)
at HTMLScriptElement.on_load (eval at append_javascript (outputarea.js:763), <anonymous>:207:9)
at window._Events.handleClearOutput (eval at append_javascript (outputarea.js:763), <anonymous>:36:26)
at window._Events.dispatch (jquery.min.js:2)
at window._Events.y.handle (jquery.min.js:2)
at Object.trigger (jquery.min.js:2)
at window._Events.<anonymous> (jquery.min.js:2)
at Function.each (jquery.min.js:2)
at w.fn.init.each (jquery.min.js:2)
at w.fn.init.trigger (jquery.min.js:2)
at w.fn.init.events.trigger (events.js:31)
at CodeCell.clear_output (codecell.js:544) Arguments(2) ["clear_output.CodeCell", {…}, callee: (...), Symbol(Symbol.iterator): ƒ]
And finally:
at embed_document (<anonymous>:6:20)
at <anonymous>:10:5
at <anonymous>:26:3
at window._Events.handleAddOutput (eval at append_javascript (outputarea.js:763), <anonymous>:76:60)
at window._Events.dispatch (jquery.min.js:2)
at window._Events.y.handle (jquery.min.js:2)
at Object.trigger (jquery.min.js:2)
at window._Events.<anonymous> (jquery.min.js:2)
at Function.each (jquery.min.js:2)
at w.fn.init.each (jquery.min.js:2)
To be honest, I don’t know what they mean, if there is some problem with my installation, or with bokeh or what is going on.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:14 (8 by maintainers)
Top GitHub Comments
The problem boils down to this:
i.e. setting
id
on an element, creates a global variable with the same name as the ID. Whenever I think that web browsers can’t sink any lower, then there’s another day to prove me wrong.Jupyter exposes this behavior, as it converts e.g.
# Bokeh
Markdown markup into<h1 id=Bokeh>Bokeh</h1>
, which in turn defineswindow.Bokeh = (... ref to h1 node ...)
, which conflicts later with initialization of bokehjs.This is because starting with bokeh 2.x, it’s now possible to load multiple versions of bokehjs into a page without any additional setup, but this seems not to work well, when
window.Bokeh
is clobbered with an unrelated object. Previouslywindow.Bokeh
was just overwritten, so the issue wasn’t visible. This is something that we can improve.I also think that Jupyter’s behavior could be improved, by not generating simple IDs from content (at least use
jp-
prefix).Hi @cuspime Have you tried this with other browsers/OS yet, as suggested in the SO comments? Have you force-reloading the page, clearing cache, or loading in a private browser? The only way to make any progress on this problem that is specific to your situation is to narrow down what about your specific situation is causing the issue. What version of notebook do you have installed? Can you also try with Jupyterlab instead of classic notebook?