High severity beginner · Fix: 2-5 min

FileNotFoundError

FileNotFoundError: [Errno 2] No such file or directory: 'chromium'

What this error means
The Python browser automation library cannot find the Chromium executable required to launch the browser.

Stack trace

traceback
FileNotFoundError: [Errno 2] No such file or directory: 'chromium'
  at pyppeteer.chromium_downloader.download_chromium (chromium_downloader.py:123)
  at pyppeteer.launcher.launch (launcher.py:45)
  at main.py:15
QUICK FIX
Run 'playwright install chromium' or equivalent to install Chromium and ensure the executable path is correctly set in your code.

Why it happens

Browser automation libraries like pyppeteer or Playwright require a Chromium browser executable to launch. This error occurs when Chromium is not installed, not downloaded, or the executable path is incorrect or missing in the environment.

Detection

Check for FileNotFoundError exceptions when launching the browser and verify if the Chromium executable path exists on the filesystem before runtime.

Causes & fixes

1

Chromium browser is not installed or downloaded on the system.

✓ Fix

Run the library's install or download command (e.g., 'playwright install' or pyppeteer's chromium download) to install Chromium.

2

The executable path for Chromium is not set or is incorrect in the launch configuration.

✓ Fix

Explicitly specify the correct path to the Chromium executable in the browser launch options.

3

Environment PATH does not include the directory containing the Chromium executable.

✓ Fix

Add the Chromium executable directory to the system PATH environment variable or provide the full path in code.

Code: broken vs fixed

Broken - triggers the error
python
from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.launch()  # FileNotFoundError: chromium not found here
    page = browser.new_page()
    page.goto('https://example.com')
    print(page.title())
    browser.close()
Fixed - works correctly
python
import os
from playwright.sync_api import sync_playwright

os.environ['PLAYWRIGHT_BROWSERS_PATH'] = '0'  # Use bundled browsers or set custom path

with sync_playwright() as p:
    browser = p.chromium.launch()  # Fixed: chromium installed and path resolved
    page = browser.new_page()
    page.goto('https://example.com')
    print(page.title())
    browser.close()
Set environment variable to use bundled browsers or ensure Chromium is installed so the launch call finds the executable.

Workaround

Catch FileNotFoundError when launching the browser, then prompt the user to run the install command or manually specify the executable path to continue.

Prevention

Automate Chromium installation as part of your deployment or CI pipeline and always verify the executable path before launching the browser to avoid runtime errors.

Python 3.7+ · playwright >=1.20.0 · tested on 1.30.x
Verified 2026-04
Verify ↗

Community Notes

No notes yetBe the first to share a version-specific fix or tip.