cocalc-docker icon indicating copy to clipboard operation
cocalc-docker copied to clipboard

WebDriverException: Message: 'geckodriver' executable needs to be in PATH

Open pascalthivierge opened this issue 5 years ago • 3 comments

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!

pascalthivierge avatar May 16 '19 16:05 pascalthivierge

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

haraldschilly avatar May 16 '19 16:05 haraldschilly

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

pascalthivierge avatar May 16 '19 16:05 pascalthivierge

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.

cocalc-docker-geckodriver

DrXyzzy avatar May 22 '19 20:05 DrXyzzy

Basically support...

williamstein avatar Mar 15 '23 15:03 williamstein