1

I am using bokeh to generate a plot and save to a disk and then show it on the browser. A new page will open in the browser and then nothing is display on the screen except the title of that page.

Here is the code I wrote:

from bokeh.plotting import figure, show, output_file
p = figure(title="Basic Title", plot_width=300, plot_height=300)
p.circle([1,2], [3,4])
output_file("test.html")
show(p)

screen shot from browser Java script errors from log

2 Answers 2

2

You are evidently running of Bokeh installed from GitHub source. In this case you must use "inline" resources. CDN resources are only published for full releases, release candidates, and "dev" builds. We do not publish CDN resources for every commit, so there will never be versions like dev13+2.<hash>.min.js available on CDN.

An easy way to use inline resources is to set the BOKEH_RESOURCES environment variable:

BOKEH_RESOURCES=inline python myscript.py

Of course the other alternative is to install a real release instead of installing from source.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks a lot. I cam to know that you are part of the development team of this tool. Thanks a lot for the great one!
I hope soon you will enable "newline" for Label text it would be very beneficial to have @bigerddot
1

As Chrome developer console mentions, your test.html file fails at fetching resources (Bokeh CSS and JS files). The version of Bokeh you use is probably the culprit here.

Try reinstalling Bokeh with pip install bokeh and it should work.

Otherwise, if you don't want or cannot reinstall it, you can manually edit your HTML file so that it points to the correct resources:

  • https://cdn.bokeh.org/bokeh/release/bokeh-0.12.5.min.css for the CSS
  • https://cdn.bokeh.org/bokeh/release/bokeh-0.12.5.min.js for the JS

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.