Panel JS cannot be found - Static Library Loading

Hi all,

I was using to panel.Video to create a simple UI on Jupyter Notebook. It worked fine on my local machine until I deployed it in a new environment (virtual machine with no internet). I checked that the version of all libraries I was using was the same (e.g. Bokeh 3.1.1 etc.).

I have also checked other online resources for a solution but none worked so far. I have ran the snippet below. Apparently, this should work to inline the resources, so that I don’t need to view the panel videos in another window. (source: Bokeh plot not showing in Jupyter. Only says "Loading BokehJS ..." - Stack Overflow)

from bokeh.resources import INLINE
import bokeh.io

bokeh.io.output_notebook(INLINE)

(As a side note, if I do .server(), everything works fine, but I need to display it in the Notebook.) But this results in a JQuery error.

Loading BokehJS ...

Javascript Error: assignment to undeclared variable jQuery

I have also looked at the developer console, which outputs the following:

When I checked with !bokeh info, it seems like the static library can be found:

Python version      :  3.8.10 (default, May 26 2023, 14:05:08) 
IPython version     :  7.22.0
Tornado version     :  6.1
Bokeh version       :  3.1.1
BokehJS static path :  /cluster/home/<username>/.local/lib/python3.8/site-packages/bokeh/server/static
node.js version     :  (not installed)
npm version         :  (not installed)
Operating system    :  Linux-5.4.0-166-generic-x86_64-with-glibc2.29

Does anyone have an idea about how to fix this issue? Could it be with versioning or does the panel simply not work without an interenet connection? I would appreciate any insight! Thanks in advance!

Similar issues. I managed to get my installation working by

  • shutting down all notebooks
  • clearing the browser cache
  • restarting jupyter lab with only one notebook open

Hope this helps

See Help! How do I get a working version of Holoviews? - #5 by ahuang11

Unfortunately that doesn’t work. I have restarted everything and cleared the cache. When I try to display a Video pane, I get the following output error.


This is quite strange since I didn’t think it would be missing the Bokeh library. It is not loading anything static, but I can see from the developer console that it is still trying to load the resource from a CDN server (e.g. https://cdn.holoviz.org/panel/1.0.0/dist/panel.min.js). I also ran the snippet

from bokeh.resources import INLINE
import bokeh.io

bokeh.io.output_notebook(INLINE)

But the same JQuery error occurs. Do you have any more suggestions about why this might be the case? Thanks in advance!

Just to add to this, I get the following error when trying to inline the resources.

Okay I managed to fix this using this issue thread (CSS is missing when inlining static resources. · Issue #5167 · holoviz/panel · GitHub and Add ability to inline internal resources in Jupyter · Issue #3013 · holoviz/panel · GitHub).

Essentially,

pn.extension(inline=True)