I can’t seem to export png plots under Bokeh 3.0.2.
$ bokeh info
Python version : 3.10.6 | packaged by conda-forge | (main, Aug 22 2022, 20:36:39) [GCC 10.4.0]
IPython version : 8.6.0
Tornado version : 6.2
Bokeh version : 3.0.2
BokehJS static path : /home/jet08013/anaconda3/envs/python310/lib/python3.10/site-packages/bokeh/server/static
node.js version : v14.15.4
npm version : 6.14.10
Operating system : Linux-5.15.0-52-generic-x86_64-with-glibc2.31
Here’s my test code:
import numpy as np
from bokeh.plotting import figure
from bokeh.io import export_png
f=figure()
x=np.linspace(-10,10,100)
y=x**2
f.line(x=x,y=y)
export_png(f,filename='out.png')
I have firefox and geckodriver in my path:
~ > which firefox py python310 11:19:04
/home/jet08013/anaconda3/envs/python310/bin/firefox
~ > which geckodriver py python310 11:20:05
/home/jet08013/anaconda3/envs/python310/bin/geckodriver
The same code works fine in my 2.4.3 environment.
Any advice?
and here’s the error message:
~ > python bokehexport.py py python310 11:20:12
Traceback (most recent call last):
File "/home/jet08013/bokehexport.py", line 9, in <module>
export_png(f,filename='out.png')
File "/home/jet08013/anaconda3/envs/python310/lib/python3.10/site-packages/bokeh/io/export.py", line 116, in export_png
image = get_screenshot_as_png(obj, width=width, height=height, driver=webdriver, timeout=timeout, state=state)
File "/home/jet08013/anaconda3/envs/python310/lib/python3.10/site-packages/bokeh/io/export.py", line 254, in get_screenshot_as_png
web_driver = driver if driver is not None else webdriver_control.get()
File "/home/jet08013/anaconda3/envs/python310/lib/python3.10/site-packages/bokeh/io/webdriver.py", line 135, in get
self.current = self.create()
File "/home/jet08013/anaconda3/envs/python310/lib/python3.10/site-packages/bokeh/io/webdriver.py", line 139, in create
driver = self._create(kind)
File "/home/jet08013/anaconda3/envs/python310/lib/python3.10/site-packages/bokeh/io/webdriver.py", line 157, in _create
raise RuntimeError("Neither firefox and geckodriver nor a variant of chromium browser and " \
RuntimeError: Neither firefox and geckodriver nor a variant of chromium browser and chromedriver are available on system PATH. You can install the former with 'conda install -c conda-forge firefox geckodriver'.