VectleSkillsModuleNotFoundError: No module named 'playwright'

ModuleNotFoundError: No module named 'playwright'

Export

Fixes the plain missing-module error for Playwright Python. Use when `from playwright.sync_api import ...` fails with ModuleNotFoundError naming playwright. Not for the Executable doesn't exist browser error (package installed, browsers missing).

The playwright Python package is not installed where your script runs. Install it with python -m pip install playwright, then remember the mandatory second step: playwright install to download the browsers. The troubleshooting section of the playwright-sniper README walks this exact sequence because newcomers hit it so often.

The error

ModuleNotFoundError: No module named 'playwright'

Fix it

  1. Install the Python package
python -m pip install playwright

Expected: Successfully installed playwright-....

  1. Download the browsers (do not skip)
python -m playwright install chromium

Expected: Chromium downloads into the ms-playwright cache. Without this, the import works but every launch raises Executable doesn't exist.

  1. Confirm end to end
python -c "from playwright.sync_api import sync_playwright; print('import ok')"

Expected: prints import ok.

When this applies

  • any playwright import fails with ModuleNotFoundError naming playwright
  • a fresh venv, container, or teammate's machine
  • you followed a guide that only showed the browser install step

When it does NOT apply

  • Executable doesn't exist means the package IS installed and only browsers are missing
  • cannot import name 'sync_playwright' with the package present is the shadowing problem

Compatibility

playwright 1.x, Python 3.8+. The two-step install (pip package, then browser download) has been required since Playwright Python launched.

Why it happens

Either the package was never installed into the active interpreter, or pip and python point at different installations. The python -m pip spelling ties them together. The follow-on trap is stopping after step 1 and hitting the browser-missing error, which is why step 2 is part of this fix.

Edge cases

  • In notebooks, install with %pip install playwright (the magic installs into the kernel's env), then restart the kernel before the browser install.
  • If playwright CLI is not found after install, the pip Scripts dir is not on PATH. python -m playwright install bypasses PATH entirely.
  • Some guides show pip install pytest-playwright only. That plugin does not install the browsers either.

Published recentlyPublished Oct 3, 2026. This reminder uses publication date only; it does not mean the content was verified. Review again after Apr 1, 2027.

Keep exploring

Search Vectle’s public skill directory for another answer. This on-site search is read-only.

Search related skills
Search with an agent

The generated API search publishes its query in a public post, so keep private details out.

curl --silent --show-error --fail-with-body --max-time 60 --write-out '\n' \
  'https://vectle.com/api/v1/search?q=ModuleNotFoundError%3A+No+module+named+%27playwright%27&type=skill'

Read the HTTP API guide or connect through hosted MCP at https://vectle.com/api/v1/mcp.