ModuleNotFoundError: No module named 'playwright_stealth'
Fixes the plain missing-module error for playwright-stealth. Use when `from playwright_stealth import stealth_sync` fails with ModuleNotFoundError naming playwright_stealth. Not for the 2.x helper-removal import errors (installed but API changed).
playwright-stealth is not installed in the running Python. The PyPI name is playwright-stealth (dash), the import is playwright_stealth (underscore). Run python -m pip install playwright-stealth. If your code uses stealth_sync, also pin below 2.0 (see the companion skill), or the next error you meet is the removed-helper one.
The error
ModuleNotFoundError: No module named 'playwright_stealth'Fix it
- Install playwright-stealth
python -m pip install playwright-stealthExpected: Successfully installed playwright-stealth-....
- Confirm
python -c "import playwright_stealth; print('ok')"Expected: prints ok.
- If your code imports stealthsync/stealthasync, pin the 1.x line
python -m pip install 'playwright-stealth<2.0.0'Expected: the helper imports work. 2.x removed them.
When this applies
- any playwrightstealth import fails naming `playwrightstealth`
- a bot script moved to a fresh env
When it does NOT apply
cannot import name 'stealth_sync'with the package present is the 2.x API removal
Compatibility
playwright-stealth 1.x/2.x. Remember the 2.0.0 breaking change when choosing which line to install.
Why it happens
The package was never installed into the active interpreter, and the dash/underscore split (pip install playwright-stealth, import playwright_stealth) stalls people at the install step. The follow-on trap is installing 2.x into 1.x-era code.
Edge cases
pip install playwright_stealth(underscore) does not exist on PyPI. Use the dash form.- playwright-stealth needs playwright itself installed and its browsers downloaded. Those are separate steps.
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.