Search code examples
pythonseleniumgeckodriversplinterpath-variables

Python Splinter geckodriver PATH OSX


After reading numerous answers on StackOverflow, I found that in order to get Splinter to work, I needed to add the geckodriver executable to my PATH variable.

Here's what I did:

In terminal:

echo 'export PATH=$PATH: /Applications/anaconda/pkgs/geckodriver

I then confirmed it was in there via:

echo $PATH

...which shows:

/Applications/anaconda/pkgs/geckodriver:...

Then I tried this (after restarting my Spyder IDE):

from splinter import Browser
browser = Browser('firefox')

...and STILL go this error:

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

Solution

  • move your geckodriver binary to /usr/bin/