Chromium binary is missing?
This error means Playwright’s Python code is present, but the Chromium binary Playwright expects is not present at runtime.
Playwright does not drive your system Chrome by default. It downloads and manages its own browser builds (Chromium, Firefox, WebKit) into a cache folder named ms-playwright. On Linux that default cache is ~/.cache/ms-playwright, so if you are running as root it becomes /root/.cache/ms-playwright. (Playwright)
Your path includes chromium-1200/.../chrome. That chromium-1200 folder is the specific pinned browser build Playwright expects for the version you are running. If the folder is missing, Playwright fails exactly like your traceback.
Background: how Playwright installs actually work
There are two separate installs:
- Install the library (Python package)
- Install the browser binaries (Chromium, etc.) into
ms-playwright
Playwright’s Python docs explicitly call out the browser install commands and the dependency install commands. (Playwright)
Also, Playwright caches browsers in folders like chromium-XXXXXX, firefox-XXXX, webkit-XXXX. (Playwright)
The most common causes (with context)
Cause 1: You installed/updated Playwright but never downloaded browsers
Typical when you run only pip install playwright (or your platform installs requirements) and you never run the browser installer.
Fix
python -m playwright install chromium
# or install all default browsers
python -m playwright install
Playwright documents playwright install and “install a specific browser” forms. (Playwright)
Why python -m playwright is often better: it reduces “wrong CLI on PATH” mistakes in multi-venv/container setups.
Cause 2: Build-time vs run-time mismatch (Docker, CI, PaaS, Gradio deployments)
You downloaded browsers in one place, then ran the app somewhere else:
- different user (
root at build time, non-root at runtime)
- different filesystem (ephemeral runtime, different container layer)
- different cache location
Playwright’s own docs say the default Linux cache is ~/.cache/ms-playwright. If the runtime user is different, that path changes. (Playwright)
Fix patterns
- Install browsers in the same image stage that runs the app.
- Run as a consistent user.
- Or set a consistent shared path via
PLAYWRIGHT_BROWSERS_PATH. (Playwright)
Example Dockerfile pattern:
RUN pip install playwright \
&& python -m playwright install --with-deps chromium
The --with-deps combo is documented. (Playwright)
Cause 3: Linux system dependencies missing
This does not usually produce “executable doesn’t exist” first, but it is the next common failure after you install browsers.
Playwright provides:
playwright install-deps
- or
playwright install --with-deps chromium (one step) (Playwright)
Fix
python -m playwright install --with-deps chromium
# or:
python -m playwright install-deps
python -m playwright install chromium
Documented in the Python “Browsers” page and CI guide. (Playwright)
Cause 4: Your environment blocks browser downloads (proxy, firewall, custom CA)
If playwright install silently fails during build, you later see the “executable doesn’t exist” error at runtime.
Playwright documents:
HTTPS_PROXY=... playwright install
- custom CA via
NODE_EXTRA_CA_CERTS
- slower networks via
PLAYWRIGHT_DOWNLOAD_CONNECTION_TIMEOUT
- internal mirror via
PLAYWRIGHT_DOWNLOAD_HOST (Playwright)
Fix
export HTTPS_PROXY="https://your-proxy"
python -m playwright install chromium
If your org MITMs TLS with a private CA, you often need NODE_EXTRA_CA_CERTS too. (Playwright)
Cause 5: You are on Gradio or Hugging Face Spaces and only used requirements.txt
This is a frequent “it installs the library but never runs the browser download step” trap.
The HF forum has the exact question: they installed Playwright via requirements but couldn’t figure out how to run playwright install, and the app errors without it. (Hugging Face Forums)
Solutions
- Use Docker Spaces and put the install step in your Dockerfile (best reliability). HF docs explain Docker Spaces and note runtime user and persistence constraints. (Hugging Face)
- If you cannot use Docker, run
python -m playwright install at startup (works but slow and requires outbound network every cold start).
Also note: HF Docker Spaces run with user ID 1000 by default, and disk data is lost on restart unless you enable persistent storage. That matters because browsers in ~/.cache/ms-playwright can disappear on restart. (Hugging Face)
Cause 6: You installed “headless shell only” but you are launching headed Chromium
Your code uses headless=False. Headed Chromium needs the full Chromium build, not only the “chromium headless shell” install.
Playwright documents that it ships a regular Chromium build for headed use and a separate headless shell, and that --only-shell skips the full build. (Playwright)
If you previously ran:
playwright install --only-shell
…then headless=False can lead to missing “full Chromium” artifacts.
Fix
python -m playwright install chromium
# without --only-shell
What to do next: a clear decision tree
If you control the machine (local dev, VM)
Run this once in the same venv:
pip install -U playwright
python -m playwright install --with-deps chromium
This is the documented one-shot “browsers + OS deps” pattern. (Playwright)
If this is Docker / CI
Do browser install in the image build:
pip install playwright
python -m playwright install --with-deps chromium
The CI doc shows the same concept (playwright install --with-deps). (Playwright)
If this is Gradio on Hugging Face Spaces
Prefer Docker Spaces and bake it into the Dockerfile. HF explicitly supports Docker Spaces for setups beyond standard Gradio, and notes user and persistence behavior that affects caches. (Hugging Face)
Debugging commands that usually pinpoint the issue in 60 seconds
- Confirm where Playwright expects browsers and what is installed:
python -m playwright install --list
Playwright documents install --list and the ms-playwright cache model. (Playwright)
- Check whether the expected folder exists:
ls -la /root/.cache/ms-playwright
- If the folder exists but the number differs (example: you have
chromium-1190 but it wants chromium-1200)
That is usually a version mismatch between the Playwright package used to install browsers and the Playwright package used at runtime. Re-run install from the runtime env using python -m playwright ....
About “install Selenium in Gradio”
That Selenium guide is solving a different problem: Selenium uses a system browser + driver model.
Your error is Playwright-specific: it cannot find its own downloaded Chromium in ms-playwright. Fixing Playwright is usually simpler than switching stacks.
If you truly want to use system Chrome with Playwright instead, Playwright supports “branded” Chrome/Edge channels, but that is a separate configuration path. (Playwright)
High-quality reading list (with what each is good for)
Summary
- The error means “Playwright cannot find the pinned Chromium binary in
ms-playwright cache.” (Playwright)
- Fix is usually
python -m playwright install chromium in the same runtime env and user. (Playwright)
- On Linux, often add
--with-deps (or install-deps). (Playwright)
- In Gradio/HF deployments, you often need Docker or a startup install step because
requirements.txt alone does not run playwright install. (Hugging Face Forums)