Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
in DevOps and Agile by (19.7k points)

I'm running a simple example of selenium on Linux:

from selenium import webdriver

from selenium.webdriver.common.keys import Keys

driver = webdriver.Firefox()


and get an error:

FileNotFoundError: [Errno 2] No such file or directory: 'geckodriver'

How to fix it?

$ python

Python 3.5.2 (default, Jun 28 2016, 08:46:01) 

[GCC 6.1.1 20160602] on linux

Type "help", "copyright", "credits" or "license" for more information.

>>> import selenium

>>> from selenium.webdriver.common.keys import Keys


1 Answer

0 votes
by (62.9k points)

Selenium requires a geckodriver to interface with Firefox. Here's how to install the geckodriver:

You can download geckodriver from this link (or if you need the 32-bit version, go to to see more download options)

Extract the file into your Downloads folder

Open a console and run this command

sudo mv ~/Downloads/geckodriver /usr/bin

If you are interested to learn Selenium on a much deeper level and want to become a professional in the testing domain, check out Intellipaat’s Selenium online training

Browse Categories