[Python] How to resolve Playwright missing dependencies error on Replit

Discussão em 'Python' iniciado por Stack, Abril 26, 2025.

  1. Stack

    Stack Membro Participativo

    I'm trying to use Playwright in a Python project on Replit. I installed it using pip install playwright, and then ran playwright install. The download of Chromium, Firefox, and WebKit seemed to complete successfully, but I received the following warning:

    Playwright Host validation warning:
    ╔══════════════════════════════════════════════════════╗
    ║ Host system is missing dependencies to run browsers. ║
    ║ Please install them with the following command: ║
    ║ ║
    ║ sudo playwright install-deps ║
    ║ ║
    ║ Alternatively, use apt: ║
    ║ sudo apt-get install libnss3\ ║
    ║ libnspr4\ ║
    ║ libdbus-1-3\ ║
    ║ libatk1.0-0\ ║
    ║ libatk-bridge2.0-0\ ║
    ║ libcups2\ ║
    ║ libxcomposite1\ ║
    ║ libxdamage1\ ║
    ║ libxfixes3\ ║
    ║ libgbm1\ ║
    ║ libxcb1\ ║
    ║ libxkbcommon0\ ║
    ║ libpango-1.0-0\ ║
    ║ libcairo2\ ║
    ║ libasound2\ ║
    ║ libatspi2.0-0 ║
    ║ ║
    ║ <3 Playwright Team ║
    ╚══════════════════════════════════════════════════════╝
    at validateDependenciesLinux (/home/runner/workspace/.pythonlibs/lib/python3.11/site-packages/playwright/driver/package/lib/server/registry/dependencies.js:216:9)
    at async Registry._validateHostRequirements (/home/runner/workspace/.pythonlibs/lib/python3.11/site-packages/playwright/driver/package/lib/server/registry/index.js:859:52)
    at async Registry._validateHostRequirementsForExecutableIfNeeded (/home/runner/workspace/.pythonlibs/lib/python3.11/site-packages/playwright/driver/package/lib/server/registry/index.js:957:7)
    at async Registry.validateHostRequirementsForExecutablesIfNeeded (/home/runner/workspace/.pythonlibs/lib/python3.11/site-packages/playwright/driver/package/lib/server/registry/index.js:946:43)
    at async t.<anonymous> (/home/runner/workspace/.pythonlibs/lib/python3.11/site-packages/playwright/driver/package/lib/cli/program.js:122:7)


    Since Replit doesn't allow sudo access, I can't install the required system dependencies via sudo playwright install-deps or apt-get.

    Is there a workaround or an alternative approach to get Playwright working properly in the Replit environment?

    Continue reading...

Compartilhe esta Página