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.

Regression: offline bokeh plot support broken

See original GitHub issue

ALL software version info

Python: 3.9

Failing versions:

bokeh: 2.4.3 holoviews: 1.15.0 panel: 0.13.0

Working versions:

bokeh: 2.3.3 holoviews: 1.14.9 panel: 0.12.1

Description of expected behavior and the observed behavior

bokeh plots aren’t working in jupyter notebook without an internet connection due to new dependencies on cdn delivered assets

Complete, minimal, self-contained example code that reproduces the issue

In a jupyter notebook in a browser without internet access. Easiest way to get it it to start firefox as follows (linux):

$ env http_proxy=http://localhost:1/ https_proxy=http://localhost:1/ firefox --profile nointernet

# notebook code
import pandas as pd
df = pd.DataFrame({'a':range(10),'b':range(10,20)})
import bokeh
import holoviews as hv
import panel as pn
print(bokeh.__version__, hv.__version__, pn.__version__)
hv.extension('bokeh', inline=True)
display(hv.Scatter(df))

Stack traceback and/or browser JavaScript console output

Browser console showing the failing assets

Bokeh: BokehJS not loaded, scheduling load and callback at 
Date Tue Oct 04 2022 09:37:23 GMT-0700 (Pacific Daylight Time)
main.min.js:44:13
Bokeh: injecting link tag for BokehJS stylesheet:  https://cdn.jsdelivr.net/npm/notyf@3/notyf.min.css main.min.js:66:15
Bokeh: injecting link tag for BokehJS stylesheet:  https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css main.min.js:66:15
failed to load https://cdn.jsdelivr.net/npm/notyf@3/notyf.min.js main.min.js:55:15
Loading failed for the <script> with source “https://cdn.jsdelivr.net/npm/notyf@3/notyf.min.js”. sample-notebook-py3.9.ipynb:1:1
Uncaught Error: Script error for "notyf"
http://requirejs.org/docs/errors.html#scripterror
    makeError require.js:168
    onScriptError require.js:1735
    load require.js:1940
    load require.js:1682
    load require.js:832
    fetch require.js:822
    check require.js:854
    enable require.js:1173
    enable require.js:1554
    enable require.js:1158
    bind require.js:134
    each require.js:59
    enable require.js:1110
    init require.js:786
    localRequire require.js:1457
    setTimeout handler*req.nextTick< require.js:1812
    localRequire require.js:1446
    requirejs require.js:1794
    load_libs main.min.js:77
    <anonymous> main.min.js:1655
    <anonymous> main.min.js:1660
    append_javascript outputarea.js:765
    append_mime_type outputarea.js:703
    append_display_data outputarea.js:664
    append_output outputarea.js:345
    handle_output outputarea.js:256
    output codecell.js:399
    _handle_output_message kernel.js:1199
    i jQuery
    _handle_iopub_message kernel.js:1239
    _finish_ws_message kernel.js:1018
    _msg_queue kernel.js:1009
    promise callback*Kernel.prototype._handle_ws_message kernel.js:1009
    i jQuery
    start_channels kernel.js:518
    _kernel_created kernel.js:413
    on_success session.js:112
    _on_success session.js:291
    jQuery 6
    ajax utils.js:797
require.js:168:17
Loading failed for the <script> with source “https://cdn.jsdelivr.net/npm/gridstack@4.2.5/dist/gridstack-h5.js”. sample-notebook-py3.9.ipynb:1:1
Uncaught Error: Script error for "gridstack"
http://requirejs.org/docs/errors.html#scripterror
    makeError http://localhost:8889/static/components/requirejs/require.js?v=d37b48bb2137faa0ab98157e240c084dd5b1b5e74911723aa1d1f04c928c2a03dedf922d049e4815f7e5a369faa2e6b6a1000aae958b7953b5cc60411154f593:168
    onScriptError http://localhost:8889/static/components/requirejs/require.js?v=d37b48bb2137faa0ab98157e240c084dd5b1b5e74911723aa1d1f04c928c2a03dedf922d049e4815f7e5a369faa2e6b6a1000aae958b7953b5cc60411154f593:1735
    load http://localhost:8889/static/components/requirejs/require.js?v=d37b48bb2137faa0ab98157e240c084dd5b1b5e74911723aa1d1f04c928c2a03dedf922d049e4815f7e5a369faa2e6b6a1000aae958b7953b5cc60411154f593:1940
    load http://localhost:8889/static/components/requirejs/require.js?v=d37b48bb2137faa0ab98157e240c084dd5b1b5e74911723aa1d1f04c928c2a03dedf922d049e4815f7e5a369faa2e6b6a1000aae958b7953b5cc60411154f593:1682
require.js:168:17
Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing sample-notebook-py3.9.ipynb:19:19

Screenshots or screencasts of the bug in action

Failing version:

image

Working version:

image

Edit: Just to add using bokeh plotting directly via output_notebook(INLINE) works fine offline.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
philippjfrcommented, Oct 4, 2022

I’ll resolve this before the Panel 0.14 release tomorrow.

0reactions
philippjfrcommented, Oct 4, 2022

Ignore my previous comment, panel.layout.gridstack is imported by default.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bokeh in offline mode - Community Support
Hi folks, I'm evaluating Bokeh for a project. One requirement is the ability to operate in an offline environment. There will be no...
Read more >
Bundle Tabulator js & css files #2285 - holoviz/panel - GitHub
Tabulator cannot be used in an offline context, although it is ... Regression: offline bokeh plot support broken holoviz/holoviews#5469.
Read more >
Interactive Data Visualization in Python With Bokeh
This Python tutorial will get you up and running with Bokeh, using examples and a real-world dataset. You'll learn how to visualize your...
Read more >
Bokeh: Unexpected (broken?) zoom behavior on line plots
I'm building a live plotting utility using Bokeh+tornado, and I'm experiencing a strange behaviour where the plot autoscaling does not ...
Read more >
Serving panel with plotly extension offline - HoloViz Discourse
I want to serve a panel entirely offline using the plotly extension. The local bokeh server instance calls on two js sources from...
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