Exporting bokeh plot

Hi,
I’m receiving this error when trying to export my plot as a .png. The program exports the .html fine.

RuntimeError Traceback (most recent call last)
in
----> 1 RGA.multi_plot(rga1,rga2)

~/.local/lib/python3.7/site-packages/RGA.py in multi_plot(ref, normalisation, plotwidth, plotheight, AMU_range, *args)
467 graph.add_layout(graph.legend[0],‘right’)
468 show(graph)
→ 469 export_png(graph, filename = output+“.png”)
470

~/.local/lib/python3.7/site-packages/bokeh/io/export.py in export_png(obj, filename, width, height, webdriver, timeout)
96 ‘’’
97
—> 98 image = get_screenshot_as_png(obj, width=width, height=height, driver=webdriver, timeout=timeout)
99
100 if filename is None:

~/.local/lib/python3.7/site-packages/bokeh/io/export.py in get_screenshot_as_png(obj, driver, timeout, resources, width, height)
220 file.write(html)
221
→ 222 web_driver = driver if driver is not None else webdriver_control.get()
223 web_driver.maximize_window()
224 web_driver.get(“file:///” + tmp.path)

~/.local/lib/python3.7/site-packages/bokeh/io/webdriver.py in get(self)
144 if not self.reuse or self.current is None:
145 self.reset()
→ 146 self.current = self.create()
147 return self.current
148

~/.local/lib/python3.7/site-packages/bokeh/io/webdriver.py in create(self, kind)
148
149 def create(self, kind: Optional[DriverKind] = None) → WebDriver:
→ 150 driver = self._create(kind)
151 self._drivers.add(driver)
152 return driver

~/.local/lib/python3.7/site-packages/bokeh/io/webdriver.py in _create(self, kind)
166 return driver
167
→ 168 raise RuntimeError("Neither firefox and geckodriver nor a variant of chromium browser and "
169 "chromedriver are available on system PATH. You can install the former "
170 “with ‘conda install -c conda-forge firefox geckodriver’.”)

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’.

Hello Jordan,
Welcome to the SWAN community forum. :smiley:

I can see that you have missing dependencies, for some reason when you want to export the plot, it is using selenium with firefox and gecko driver to generate the plot. maybe because of the nature of bokeh is javascript.

I am going to talk with the team, to see if we can provide those dependencies in the system and I’ll let you know.

Cheers
Omar.

Hi Omar,

Thanks for looking into this for me.
I have all the same packages in my anaconda environment and it works fine there, just not on SWAN for some reason.

Cheers,
Jordan

Hi Jordan,

I talked with the team and we think that bokeh is a good and popular library for plotting and we would like to have in the software stacks.
This kind of packages and dependencies are handled by the librarians,
please lets to open a ticket here https://sft.its.cern.ch/jira/projects/SPI/summary
and let me know the ticket to follow the process.

Best Regards,
Omar

Hi Omar,

I have raised the ticket SPI/SPI-1748 concerning this issue.

Thanks once again,
Jordan

1 Like