cocalc-docker
cocalc-docker copied to clipboard
WebDriverException: Message: 'geckodriver' executable needs to be in PATH
Hi!
I tried to install geckodriver in ~/.local/bin as it is recommended, but when working in a Jupyter notebook with selenium, it doesn't find it in the path.
I tried to append the location to the path, and move the file to a place in the path (./local/lib/python3.6/site-packages), but it doesn't work either.
Is there any way to install that kind of drivers for use in Cocalc Jupyter notebooks?
Thanks in advance!
how did you change the path? I'm just guessing: maybe prior to loading selenium, you have to do it in a cell via python. e.g.
import sys, os
sys.path = [os.path.expanduser("~/.local/bin")] + sys.path
Thanks for the prompt answer. I restarted the project, run the cell stated above (the path gets added to sys.path), then imported selenium. Unfortunately, it still doesn't work.
whereis geockdriver geckodriver: /projects/(project ID)/.local/bin/geckodriver
By "it still doesn't work", do you mean geckodriver still isn't in the path?
You might modify the PATH environment variable.
os.environ['PATH']=os.path.expanduser("~/.local/bin")+":"+os.environ['PATH']
With that change, the path error goes away, but there is still the generic error "Message: invalid argument: can't kill an exited process".
What does work for me is not using Jupyter, but running the same python code in a .x11 session in CoCalc-docker (and in cocalc.com, by the way). Hope this helps.
Basically support...