Using Bokeh in Spyder

Hello,

I am trying to do “first steps 1” creating a line plot from Spyder.

When I do so, and run the command “show(p)”,

it opens a Firefox browser that says

“Firefox can’t find the file at /tmp/tmp26vnnowe.html”

I would like to be able to see the plots within a Spyder popup window instead of Firefox. Is this possible? I’m not sure what I’m doing wrong here, why I can’t plot from Spyder.

I realize this is a totally noob question, but I’m seriously stuck.

Thanks!

Bokeh specifically (and only[1]) generates output to that can be viewed in browsers, using a Javascript runtime library BokehJS. Is the Spyder popup window a browser window of some sort, capable of executing JavaScript code? If not, then Bokeh will definitely not be able to display to it. If it is, I can’t really comment as to why it is not showing up there, as I have never used Spyder. This question might be better posed on a Spyder support forum.

As for the tmp file error, when you run show (with output_file mode) without any arguments, Bokeh saves temporary HTML file to raise in the default browser. If the file is not there, my best guess would be some permissions problem prevented the save from happening. It is possible to specify an explicit location to save to to output_file, in case that helps.


  1. Bokeh does have APIs to export PNGs and SVGs, but these also go through a browser to function. ↩︎

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.