Python Forum
Getting error 'geckodriver' executable needs to be in PATH.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting error 'geckodriver' executable needs to be in PATH.
#1
I am executing the following python program, and getting error mentioned "'geckodriver' executable needs to be in PATH. "

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

driver = webdriver.Firefox()
driver.get("http://www.python.org")
assert "Python" in driver.title
elem = driver.find_element_by_name("q")
elem.clear()
elem.send_keys("pycon")
elem.send_keys(Keys.RETURN)
assert "No result found." not in driver.page_source
driver.close()
Error:
/usr/bin/python2.7 /home/csurv_4/PycharmProjects/web_parsing/entering_in_page.py Traceback (most recent call last): File "/home/csurv_4/PycharmProjects/web_parsing/entering_in_page.py", line 4, in <module> driver = webdriver.Firefox() File "/usr/lib/python2.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 148, in __init__ self.service.start() File "/usr/lib/python2.7/site-packages/selenium/webdriver/common/service.py", line 83, in start os.path.basename(self.path), self.start_error_message) selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH. Process finished with exit code 1
I want to know that why the error is coming and what is the resolution of this error? Please explain.
I am using fedora operating system and pycharm editor.
Reply
#2
http://lmgtfy.com/?q=python+geckodriver+path
Reply
#3
Download the proper geckodriver depending upon your operating system and System Architecture from the url here - geckodriver

Now follow the below steps -
Extract the geckodriver file from the downloaded zip file. Now depending upon your operating system do the following.

For Linux system :

Open terminal and login as root user. copy/move the extracted geckodriver to bin direcctory.
In my case I moved the file to /usr/bin directory. Because the driver finds geckodriver binary in '/usr/bin' path and the problem is solved now.

To move the file inside bin directory use command like -

$mv 'geckodriver binary source path' 'destination path'
destination path should be the binary folder path as per user system.

For Windows System :
Just execute the the extracted geckodriver binary file.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  WebDriverException: 'chromedriver' executable needs to be in PATH pyzyx3qwerty 9 12,730 Jun-09-2020, 05:43 PM
Last Post: Yoriz
  Selenium error with ebdriver (geckodriver) Martinelli 4 4,704 Sep-24-2019, 01:40 AM
Last Post: Martinelli
  How to geckodriver anonymous firefox mariolopes 5 7,191 Feb-10-2018, 10:58 PM
Last Post: mariolopes

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020