Fosowl/agenticSeek · critical · FileNotFoundError

ChromeDriver not found. Please install it or add it to your

Error message

ChromeDriver not found. Please install it or add it to your PATH.

What it means

After the auto-install attempt, install_chromedriver() checks the returned path; if chromedriver_autoinstaller.install() returned None/empty (installed nothing), it raises this FileNotFoundError. Unlike the wrapped-exception case, the auto-installer did not throw — it simply failed to produce a usable path.

Source

Thrown at sources/browser.py:148

        docker_chromedriver_path = "/usr/local/bin/chromedriver"
        if os.path.exists(docker_chromedriver_path) and os.access(docker_chromedriver_path, os.X_OK):
            print(f"Using Docker ChromeDriver at {docker_chromedriver_path}")
            return docker_chromedriver_path
    
    # Auto-install matching ChromeDriver version
    try:
        print("Installing matching ChromeDriver version automatically...")
        chromedriver_path = chromedriver_autoinstaller.install()
    except Exception as e:
        raise FileNotFoundError(
            "ChromeDriver not found and could not be installed automatically. "
            "Please install it manually from https://chromedriver.chromium.org/downloads."
            "and ensure it's in your PATH or specify the path directly."
            "See know issues in readme if your chrome version is above 115."
        ) from e
    
    if not chromedriver_path:
        raise FileNotFoundError("ChromeDriver not found. Please install it or add it to your PATH.")
    return chromedriver_path

def bypass_ssl() -> str:
    """
    This is a fallback for stealth mode to bypass SSL verification. Which can fail on some setup.
    """
    pretty_print("Bypassing SSL verification issues, we strongly advice you update your certifi SSL certificate.", color="warning")
    ssl._create_default_https_context = ssl._create_unverified_context

def get_free_port() -> int:
    """Find and return a free TCP port on the local machine."""
    with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
        s.bind(('', 0))
        return s.getsockname()[1]

def create_chrome_options(headless=False, stealth_mode=True, crx_path="./crx/nopecha.crx", lang="en") -> Options:
    """Create Chrome options - separated for reusability."""
    chrome_options = Options()

View on GitHub (pinned to ae57a23577)

Solutions

  1. Install a ChromeDriver binary explicitly and ensure it is on PATH (`which chromedriver` resolves), or pass the full path to the driver factory.
  2. Reinstall/upgrade chromedriver-autoinstaller and clear its cache, then retry auto-install.
  3. Install a standard Google Chrome build so the version detector can match a driver.
  4. Verify the chromedriver binary is executable (chmod +x) and runs (`chromedriver --version`).

Example fix

// before
chromedriver_path = None  # autoinstaller returned nothing -> FileNotFoundError
// after
which chromedriver  # /usr/local/bin/chromedriver after manual install
chromedriver --version  # verify it executes
driver = create_driver()
Defensive patterns

Strategy: fallback

Validate before calling

import shutil, subprocess
def require_chromedriver() -> str:
    path = shutil.which("chromedriver")
    if path is None:
        raise RuntimeError("chromedriver not on PATH; install it or add its directory to $PATH")
    subprocess.run([path, "--version"], check=True, capture_output=True)
    return path
require_chromedriver()
driver = create_driver()

Try / catch

try:
    driver = create_driver()
except FileNotFoundError as e:
    if "ChromeDriver not found. Please install it" in str(e):
        driver = create_driver(driver_path="/usr/local/bin/chromedriver")
    else:
        raise

Prevention

When it happens

Trigger: chromedriver_autoinstaller.install() completes without exception but returns a falsy path (detection could not find/install a driver), so `if not chromedriver_path` fires and install_chromedriver raises FileNotFoundError, propagating to create_driver.

Common situations: Chrome installed via unusual channel (snap, flatpak, dev/beta builds) so version detection fails; partial auto-installer cache; minimal containers where detection utilities are missing; corrupted autoinstaller cache directory.

Related errors


AI-assisted analysis of Fosowl/agenticSeek@ae57a23577 (2026-08-30). Data as JSON: /api/errors/f8b0df2b02b60712. Report an issue: GitHub.