python
system_error
ai_generated
true
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH.
ID: python/pytest-selenium-webdriver-exception
80%Fix Rate
87%Confidence
0Evidence
2025-05-05First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.x | active | — | — | — |
Root Cause
Selenium cannot find the ChromeDriver executable. This occurs when ChromeDriver is not installed, not in PATH, or the version is incompatible with the installed Chrome browser.
generic中文
Selenium 找不到 ChromeDriver 可执行文件。这发生在 ChromeDriver 未安装、不在 PATH 中,或版本与已安装的 Chrome 浏览器不兼容时。
Workarounds
-
98% success
pip install webdriver-manager from selenium import webdriver from webdriver_manager.chrome import ChromeDriverManager driver = webdriver.Chrome(ChromeDriverManager().install())
-
90% success
driver = webdriver.Chrome(executable_path='/path/to/chromedriver')
-
95% success
Check Chrome version: chrome://version/ Download matching ChromeDriver from https://chromedriver.chromium.org/
Dead Ends
Common approaches that don't work:
-
70% fail
If the version is incompatible with Chrome, Selenium will still fail with a different error.
-
80% fail
This relies on PATH and may fail if chromedriver is not installed system-wide.
-
90% fail
Does not solve the missing driver issue and may introduce other incompatibilities.