Parikshit Bhinde
Parikshit Bhinde

Reputation: 495

Bokeh show() not opening in default browser

Till an hour ago, upon running my program which has a Bokeh show(plot) statement, the plot used to show in Chrome which is the default browser. However, the same program and statement are now causing Firefox to open up and half of the time Firefox won't show any plot. I am using Spyder 3.1.4 on MacOS Sierra. I checked inside Chrome settings and it shows that Chrome is the default browser. I also checked on General settings in System Preferences where Chrome is showing as the default browser. Uninstalling Firefox and then running the program causes the plots to show in Safari (where the plots at least show up all the time). Is there a way to get the plots to show on Chrome ?

Upvotes: 1

Views: 4876

Answers (2)

Skowt
Skowt

Reputation: 411

There's a bug with the latest version of MacOS' osascript application which is causing a bug in webbrowser.

You can see chatter about it here: https://bugs.python.org/issue30392

Upvotes: 1

bigreddot
bigreddot

Reputation: 34568

Bokeh uses the Python standard library webbrowser module. If it's opening up something besides Chrome, then that's because Python itself has decided that Chrome is not the default browser (for whatever reason, I can't speculate).

However, if you refer to the documentation, you can see that show accepts a browser parameter:

show(browser="chrome")

which will let you specify any browser you like instead of using whatever the Python default is.

Alternatively, there is an environment variable you can set:

BOKEH_BROWSER="chrome" python foo.py

Upvotes: 2

Related Questions