Playwright (Python) "Executable doesn’t exist / run install" in CI
The Playwright Python package installs the API, but the actual browser binaries (and their Linux host libraries) are a separate download. Without playwright install, launching a browser fails because the executable isn’t there.
What this error means
A test using Playwright fails at launch() with "Executable doesn’t exist" pointing at a browser path under ~/.cache/ms-playwright, telling you to run playwright install - or it launches but crashes for missing shared libraries.
playwright._impl._errors.Error: Executable doesn't exist at
/home/runner/.cache/ms-playwright/chromium-1140/chrome-linux/chrome
╔══════════════════════════════════════════════════════╗
║ Looks like Playwright was just installed or updated. ║
║ Please run the following command to download new ║
║ browsers: playwright install ║
╚══════════════════════════════════════════════════════╝Common causes
Browser binaries not downloaded
pip install playwright installs only the Python bindings. The Chromium/Firefox/WebKit binaries must be fetched separately with playwright install.
Missing host OS libraries on Linux
Even with browsers downloaded, headless Chromium needs system libraries (libnss, libatk, fonts). On a slim image they’re absent, so the browser process won’t start.
How to fix it
Install browsers and their dependencies
pip install playwright
playwright install --with-deps chromium # browsers + OS libsInstall host deps separately if needed
python -m playwright install-deps
python -m playwright install chromiumCache the browser download
Cache ~/.cache/ms-playwright keyed on the Playwright version so installs don’t refetch every run.
- uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-${{ hashFiles('requirements.txt') }}How to prevent it
- Run
playwright install --with-depsas a dedicated CI step. - Use the official Playwright Python Docker image to get browsers + libs preinstalled.
- Cache the ms-playwright browser directory keyed on the Playwright version.