{"record":{"id":"f8b0df2b02b60712","repo":"Fosowl/agenticSeek","slug":"chromedriver-not-found-please-install-it-or-add-i","errorCode":null,"errorMessage":"ChromeDriver not found. Please install it or add it to your PATH.","messagePattern":"ChromeDriver not found\\. Please install it or add it to your PATH\\.","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"critical","filePath":"sources/browser.py","lineNumber":148,"sourceCode":"        docker_chromedriver_path = \"/usr/local/bin/chromedriver\"\n        if os.path.exists(docker_chromedriver_path) and os.access(docker_chromedriver_path, os.X_OK):\n            print(f\"Using Docker ChromeDriver at {docker_chromedriver_path}\")\n            return docker_chromedriver_path\n    \n    # Auto-install matching ChromeDriver version\n    try:\n        print(\"Installing matching ChromeDriver version automatically...\")\n        chromedriver_path = chromedriver_autoinstaller.install()\n    except Exception as e:\n        raise FileNotFoundError(\n            \"ChromeDriver not found and could not be installed automatically. \"\n            \"Please install it manually from https://chromedriver.chromium.org/downloads.\"\n            \"and ensure it's in your PATH or specify the path directly.\"\n            \"See know issues in readme if your chrome version is above 115.\"\n        ) from e\n    \n    if not chromedriver_path:\n        raise FileNotFoundError(\"ChromeDriver not found. Please install it or add it to your PATH.\")\n    return chromedriver_path\n\ndef bypass_ssl() -> str:\n    \"\"\"\n    This is a fallback for stealth mode to bypass SSL verification. Which can fail on some setup.\n    \"\"\"\n    pretty_print(\"Bypassing SSL verification issues, we strongly advice you update your certifi SSL certificate.\", color=\"warning\")\n    ssl._create_default_https_context = ssl._create_unverified_context\n\ndef get_free_port() -> int:\n    \"\"\"Find and return a free TCP port on the local machine.\"\"\"\n    with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:\n        s.bind(('', 0))\n        return s.getsockname()[1]\n\ndef create_chrome_options(headless=False, stealth_mode=True, crx_path=\"./crx/nopecha.crx\", lang=\"en\") -> Options:\n    \"\"\"Create Chrome options - separated for reusability.\"\"\"\n    chrome_options = Options()","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/Fosowl/agenticSeek/blob/ae57a2357745a9706cb12d0fd76d954c84d166fa/sources/browser.py#L130-L166","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Install a ChromeDriver binary explicitly and ensure it is on PATH (`which chromedriver` resolves), or pass the full path to the driver factory.","Reinstall/upgrade chromedriver-autoinstaller and clear its cache, then retry auto-install.","Install a standard Google Chrome build so the version detector can match a driver.","Verify the chromedriver binary is executable (chmod +x) and runs (`chromedriver --version`)."],"exampleFix":"// before\nchromedriver_path = None  # autoinstaller returned nothing -> FileNotFoundError\n// after\nwhich chromedriver  # /usr/local/bin/chromedriver after manual install\nchromedriver --version  # verify it executes\ndriver = create_driver()","handlingStrategy":"fallback","validationCode":"import shutil, subprocess\ndef require_chromedriver() -> str:\n    path = shutil.which(\"chromedriver\")\n    if path is None:\n        raise RuntimeError(\"chromedriver not on PATH; install it or add its directory to $PATH\")\n    subprocess.run([path, \"--version\"], check=True, capture_output=True)\n    return path\nrequire_chromedriver()\ndriver = create_driver()","typeGuard":null,"tryCatchPattern":"try:\n    driver = create_driver()\nexcept FileNotFoundError as e:\n    if \"ChromeDriver not found. Please install it\" in str(e):\n        driver = create_driver(driver_path=\"/usr/local/bin/chromedriver\")\n    else:\n        raise","preventionTips":["Verify `chromedriver --version` works in the target environment before running automation.","chmod +x the chromedriver binary after manual download.","Prefer standard Chrome builds so autoinstaller version detection succeeds.","Reinstall/upgrade chromedriver-autoinstaller if install() silently returns None."],"tags":["selenium","chromedriver","environment","browser"],"backgroundTag":"chromedriver-not-in-path","analyzedSha":"ae57a2357745a9706cb12d0fd76d954c84d166fa","analyzedAt":"2026-08-30T02:49:05.834Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}