Skip to content

Python ‘geckodriver’ executable needs to be in a PATH

Recently I needed to scrap some data using selenium on python. I never actually used selenium before, but I do have experience with other headless web browsers. Anyways, when I first installed selenium from the python console using pip install selenium --user and ran the code, it gave me a message saying

Message: 'geckodriver' executable needs to be in PATH.
Basically there were two issues at hand
  1. I did not have gecko driver installed.
  2. Windows couldn’t find the path to my geckodriver file.

To solve this, you need to

  1. Download geckodriver here. Choose Windows x32 or x64 accordingly.
  2. The cleanest way, without bloating your path environment variables, is to put geckodriver.exe, the file downloaded from step 1, into your Python folder. This is because there is usually a path environment variable set to your python directory, and it its path is usually like C:\Program Files\Python35.

Done. Now when you run your code again, everything should work fine.

 

Enjoyed the content ? Share it with your friends !
Published inUncategorized

Be First to Comment

Leave a Reply

Your email address will not be published.