Missing geckodriver and/or firefox (but they are in PATH)

I have installed selenium via pip3.7 (no conda here) to be able to export_png, but

  File "/home/pi/.local/lib/python3.7/site-packages/bokeh/io/webdriver.py", line 140, 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'.

but I do have them

$ which firefox
/usr/bin/firefox
$ which geckodriver
/home/pi/bin/geckodriver

I have also tried different versions in different locations, e.g.

$ which geckodriver
/usr/local/bin//geckodriver

somehow Boekh is not seeing it/them. Any tips or hints on how to gain more insight on what is not seen by bokeh (firefox or gecko)?

I am on raspbian, if that matters and this bokeh 2.1.1
Thanks,
Roberto

PS
On OSX this went all fine and export_png works very well.

Just to add that I have removed selenium and reinstalled firefox, but this has not brought any improvement. I have also updated bokeh, just in case, no good.

This is happening on a headless machine, so I had not noted it before, but I have realized that despite the complaint that firefox and/or geckodriver are missing, a firefox window is opened on this machine! (and bokeh is not even caring to close ti afterwars)

    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'.
r $ which firefox
/usr/bin/firefox
 $ ps -e | grep firefox
25795 pts/9    00:00:25 firefox-esr

Upon further inspection the firefox I was getting open was not able to open the requested webpage. I tried a simple script to debug this.

from selenium import webdriver

driver = webdriver.Firefox()
driver.get('http://www.google.com/');

This made me suspect. I have realized that there is a version-match need for all these to work, so the best might be to get chrome-browser and its driver from apt.

sudo apt-get install chromium-browser
sudo apt-get install chromium-chromedriver

so that they will be same version and are going to be Raspbian compatible ( armhf 72.0.3626.121-0+rpt4 version at the time of writing).

The webdriver and browser definitely need to be a compatible version pair. If there is some way to programmatically determine this, we could potentially check and warn, but that’s about the best we could do (it’s out of our hands what versions users install)