Blog › Python · Published 2026-11-26

Fix Selenium error: geckodriver executable needs to be in PATH

Selenium needs a driver (geckodriver for Firefox). Recent Selenium versions include Selenium Manager, which downloads the driver for you:

pip install -U selenium
from selenium import webdriver
driver = webdriver.Firefox()

If you must use your own driver file:

from selenium.webdriver.firefox.service import Service
driver = webdriver.Firefox(service=Service("/path/to/geckodriver"))

Official sources

Need help with your project?
We build websites, systems and automation. Start your project WhatsApp

All articles