Fosowl/agenticSeek · critical · FileNotFoundError

Google Chrome not found. Please install it.

Error message

Google Chrome not found. Please install it.

What it means

create_chrome_options() resolves the Chrome browser binary via get_chrome_path(); if no Chrome installation is found it raises this FileNotFoundError before building Options. It is called by both create_driver and create_undetected_chromedriver, so any browser automation path requires Google Chrome (or a compatible Chromium the helper detects) to be present.

Source

Thrown at sources/browser.py:170

    """
    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()
    chrome_path = get_chrome_path()
    
    if not chrome_path:
        raise FileNotFoundError("Google Chrome not found. Please install it.")
    chrome_options.binary_location = chrome_path
    
    if headless:
        chrome_options.add_argument("--headless=new")
        chrome_options.add_argument("--disable-gpu")
        chrome_options.add_argument("--disable-webgl")
    
    user_agent = get_random_user_agent()
    width, height = (1920, 1080)
    profile_dir = f"/tmp/chrome_profile_{uuid.uuid4().hex[:8]}"
    
    # Core options
    chrome_options.add_argument("--no-sandbox")
    chrome_options.add_argument('--disable-dev-shm-usage')
    chrome_options.add_argument(f'--user-data-dir={profile_dir}')
    chrome_options.add_argument(f"--accept-lang={lang}-{lang.upper()},{lang};q=0.9")
    chrome_options.add_argument("--disable-extensions")
    chrome_options.add_argument("--disable-background-timer-throttling")

View on GitHub (pinned to ae57a23577)

Solutions

  1. Install Google Chrome (stable) for your platform and retry.
  2. If Chrome is installed elsewhere, ensure it is on PATH or set the binary location the helper checks (e.g. chrome_options.binary_location / CHROME_PATH env) to the full executable path.
  3. In Docker, use a base image with Chrome or add it to the Dockerfile and required OS libs.
  4. As a last resort, patch/point get_chrome_path() to a Chromium binary compatible with the automation flow.

Example fix

// before
driver = create_driver()  # FileNotFoundError: Google Chrome not found
// after
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
apt-get install -y ./google-chrome-stable_current_amd64.deb
driver = create_driver()
Defensive patterns

Strategy: validation

Validate before calling

import shutil
def chrome_installed() -> bool:
    return any(shutil.which(b) for b in (
        "google-chrome", "google-chrome-stable", "chrome",
        "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"))
if not chrome_installed():
    raise SystemExit("Install Google Chrome before running browser automation")
driver = create_driver()

Try / catch

try:
    driver = create_driver()
except FileNotFoundError as e:
    if "Google Chrome not found" in str(e):
        raise SystemExit("Install Google Chrome: https://www.google.com/chrome/") from e
    raise

Prevention

When it happens

Trigger: Calling create_driver() or create_undetected_chromedriver() on a machine where get_chrome_path() returns None — Google Chrome not installed, installed in a non-standard location, or only Chromium/another browser present that the lookup does not check.

Common situations: CI/headless Linux containers or servers without a desktop browser; fresh machines where only Firefox/Chromium is installed; macOS/Windows non-default install paths; Docker images missing the Chrome dependency.

Related errors


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