holoviews: BokehJS library missing; plots won't show in jlab
This is in a fresh environment, just set up with conda install -c holoviz hvplot and installing the jupyterlab comms with jupyter labextension install @pyviz/jupyterlab_pyviz. This echoes this from stack overflow, but I see it wasn’t tagged with holoviews: https://stackoverflow.com/questions/66474476/bokehjs-library-missing-error-and-no-plot
ALL software version info
holoviews 1.14.2 bokeh 2.3.0 hvplot 0.7.1 jupyterlab 2.2.6 mac OS 10.14.6 chrome 88.0.4324.182
Description of expected behavior and the observed behavior
Expected that plots show up.
Complete, minimal, self-contained example code that reproduces the issue
import hvplot.pandas
import pandas as pd
import numpy as np
df = pd.DataFrame({'x': np.random.random(100), 'y': np.random.random(100)})
df.hvplot('x', 'y')
Stack traceback and/or browser JavaScript console output
index.es6.js:211 Error: Cannot send
at a.send (comm.js:119)
at l._disposePlot (renderer.js:192)
at l.dispose (renderer.js:215)
at t.dispose (index.es6.js:2599)
at t.e.dispose (index.es6.js:919)
at _clear (widget.js:298)
at _.onModelChanged (widget.js:223)
at m (index.es6.js:459)
at Object.c [as emit] (index.es6.js:416)
at e.emit (index.es6.js:99)
JGtG.t.exceptionHandler @ index.es6.js:211
m @ index.es6.js:462
c @ index.es6.js:416
e.emit @ index.es6.js:99
_onListChanged @ model.js:231
m @ index.es6.js:459
c @ index.es6.js:416
e.emit @ index.es6.js:99
clear @ observablelist.js:238
clear @ model.js:144
clearExecution @ model.js:311
t @ widget.js:781
a @ actions.js:1341
(anonymous) @ actions.js:1292
o @ actions.js:1292
d @ actions.js:399
execute @ index.js:690
e.execute @ index.es6.js:357
e._executeKeyBinding @ index.es6.js:517
e.processKeydownEvent @ index.es6.js:456
e.evtKeydown @ index.es6.js:355
e.handleEvent @ index.es6.js:311
VM861:19 Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 18 (8 by maintainers)
Just updating
panelwasn’t working for me, but I think I wasn’t getting the newest version, probably due to something else requiring an older one. I ranconda update --all -c pyviz -c conda-forge, as also suggested in #4875 (after also clearing all outputs, clearing cache, and hard reloading), and now things are rendering again.Following advice in issue #4875 to update
panel(conda install panel -c pyviz) seemed to clear up this problem for me. Could be a coincidence?I have a pretty similar issue I think. In plain jupyter, I get the “Unable to run BokehJS code because BokehJS library is missing” but in jupyterlab I get a warning about python/JS bokeh version and then an error:
That specific version of the jupyterlab extension doesn’t work for me, saying it is not compatible with my the current JupyterLab. I assume that is because I am on jupyterlab 1.2.6
UPDATE: I made a new environment with jupyterlab 2 and the pyviz extension above, and can confirm that it works.
I confirm this behavior.
hv.extension("bokeh")must be set in a different cell, then it works, with the latest panel in both jupyter notebook AND jupyter lab.I was getting this issue again recently, even after creating a new environment that only had holoviews, bokeh, and ipykernel installed. When I put
no plots would show and there was the same error in the console about bokehjs missing. But if I did
hv.extension("matplotlib")first thenhv.extension("bokeh"), the plots would work. Posting in case this helps anybody else / future me.EDIT: oddly, I needed to have the two calls to
hv.extensionin separate cells, but it worked even if both werehv.extension("bokeh"). It even works if I haveimport holoviews as hvin the first cell thenhv.extension("bokeh")in the second cell, but not if I have both in the first cell. I’m also gettingException opening new commin the console when trying to usePipes to send data to aDynamicMap, but I’m not sure if that’s related.Just wanted to add - I produced same error and issue when updating to bokeh 2.3.0/panel 0.11.1/holoviews 1.14.2, and I followed these steps here (updating panel to the pyviz channel, clearing output and notebooks, restarting kernels, reloading the page) made my plots start showing up correctly in JupterLab, however the interaction/widget use in a panel dashboard was still broken and unresponsive. I had to re-install the @pyviz/jupyterlab_pyviz extension in order for widgets to start responding again. Thanks
A lot of the issues here are likely down to old versions of Bokeh sticking around in a notebook. So what I’d recommend is:
Also just confirmed that I get the same in plain jupyter notebook rather than jlab.