nexu-io/open-design · error · SystemExit
Missing playwright. Run: python3 -m pip install playwright &
Error message
Missing playwright. Run: python3 -m pip install playwright && python3 -m playwright install chromium
What it means
Raised inside an inline Python heredoc embedded in a shell snippet (humanize_ppt_v2.py:1313) as `raise SystemExit(...)`. The heredoc launches Playwright to render an HTML deck to PDF; if `from playwright.async_api import async_playwright` raises any Exception, the script aborts with a SystemExit and prints the install instructions. The check is a broad `except Exception`, so any import-time failure (missing package, broken install, ABI mismatch) triggers it.
Source
Thrown at plugins/community/humanize-ppt/scripts/humanize_ppt_v2.py:1313
def export_script_text():
return """#!/usr/bin/env bash
set -euo pipefail
HERE="$(cd "$(dirname "$0")" && pwd)"
HTML="${1:-$HERE/package/index.html}"
OUT="${2:-$HERE/deck.pdf}"
python3 - "$HTML" "$OUT" <<'PY'
import asyncio, sys
from pathlib import Path
html_path = Path(sys.argv[1]).resolve()
out_path = Path(sys.argv[2]).resolve()
async def main():
try:
from playwright.async_api import async_playwright
except Exception:
raise SystemExit("Missing playwright. Run: python3 -m pip install playwright && python3 -m playwright install chromium")
async with async_playwright() as p:
browser = await p.chromium.launch()
page = await browser.new_page(viewport={"width": 1920, "height": 1080})
await page.goto(html_path.as_uri(), wait_until="networkidle")
await page.pdf(path=str(out_path), width="1920px", height="1080px", print_background=True)
await browser.close()
asyncio.run(main())
print(out_path)
PY
"""
def write_export_adapter(out, title, deck_path, slide_count):
deck = Path(deck_path).expanduser() if deck_path else None
if not deck or not deck.exists():
return {"status": "missing-deck", "message": f"deck not found: {deck_path}"}
View on GitHub (pinned to 5be4028344)
Solutions
- Run the exact commands in the message in the same interpreter: `python3 -m pip install playwright && python3 -m playwright install chromium`.
- Confirm the import works before re-running: `python3 -c "from playwright.async_api import async_playwright; print('ok')"`.
- If pip reports playwright already installed but import fails, reinstall cleanly: `python3 -m pip install --force-reinstall playwright` then re-run the browser install.
- In CI/containers, cache `~/.cache/ms-playwright` (the browser binaries) between runs so `playwright install chromium` is idempotent and fast.
Example fix
// before (PDF export step fails) # SystemExit: Missing playwright. Run: python3 -m pip install playwright && ... // after python3 -m pip install playwright python3 -m playwright install chromium python3 -c "from playwright.async_api import async_playwright" # verify # re-run the humanize-ppt step that triggered PDF export
Defensive patterns
Strategy: validation
Validate before calling
import importlib.util
if importlib.util.find_spec('playwright') is None:
raise SystemExit(
"Playwright is required for PDF export. "
"Run: python3 -m pip install playwright && "
"python3 -m playwright install chromium"
)
# also verify chromium is installed:
# python3 -m playwright install chromium (idempotent) Prevention
- Treat Playwright as a hard prerequisite: document the two-step install (pip + browser download).
- In CI, cache ~/.cache/ms-playwright to avoid re-downloading browsers each run.
- Add a preflight `python3 -c "from playwright.async_api import async_playwright"` before the PDF stage.
- Pin playwright versions to avoid surprise ABI breakages.
When it happens
Trigger: The PDF export step runs (shell function invoked with an HTML path and output PDF path) on a machine where Playwright is not installed, only partially installed (package present but browsers missing), or where the async_api module cannot be imported due to a corrupted environment.
Common situations: Fresh machine that has the humanize-ppt scripts but never ran Playwright setup; user installed `playwright` via pip but forgot `python3 -m playwright install chromium`; CI image caching python packages but not the browser binaries; conflicting Playwright versions across venvs.
Related errors
- render_for_html_comparison requires at least one report
- render_comparison_multi requires at least one report
- render_comparison_multi_context requires at least one report
- source not found: {path}
- brief mode reads markdown/text raw material, not rendered de
AI-assisted analysis of nexu-io/open-design@5be4028344 (2026-08-12).
Data as JSON: /api/errors/8866f0b15efbc49c.
Report an issue: GitHub.