Skip to content

[Bug]: Installation fails if binary distributions are prohibited #43599

Closed
microsoft/playwright-python
#3295

Description

@lubo

Version

1.58.0

Steps to reproduce

  1. Prohibit binary distributions by setting installer.no-binary to :all: or true.
  2. Run $ poetry add playwright.

Expected behavior

Installing playwright package succeeds.

Actual behavior

$ poetry add playwright
Using version ^1.58.0 for playwright

Updating dependencies
Resolving dependencies... (2.5s)

Package operations: 3 installs, 0 updates, 0 removals

  - Installing greenlet (3.3.2)
  - Installing pyee (13.0.1)
  - Installing playwright (1.58.0): Failed

    | Unable to find installation candidates for playwright (1.58.0)
    | 
    | This is likely not a Poetry issue.
    | 
    |   - 8 candidate(s) were identified for the package
    |   - 8 wheel(s) were skipped due to your installer.no-binary policy
    | 
    | Solutions:
    | Make sure the lockfile is up-to-date. You can try one of the following;
    | 
    |     1. Regenerate lockfile: poetry lock --no-cache --regenerate
    |     2. Update package     : poetry update --no-cache playwright
    | 
    | If any of those solutions worked, you will have to clear your caches using (poetry cache clear --all).
    | 
    | If neither works, please first check to verify that the playwright has published wheels available from your configured source that are compatible with your environment- ie. operating system, architecture (x86_64, arm64 etc.), python interpreter.

Additional context

Seems like no platform-independent distribution is available on PyPI. After investigating the package, it seems like the only reason for this is driver/node, which seems to be Node.js executable. I already do have Node.js installed on my system and I checked the version compatibility here.

So, I'd like to not be forced to have this executable on my system and have Playwright use the system Node.js. And that's exactly what the Arch Linux package has been doing.

Created from microsoft/playwright-python#3036.

Environment

- Operating System: Arch Linux
- CPU: x86_64
- Browser: All
- Python Version: 3.14.3
- Other info:
  - Poetry version: 2.3.2

Activity

  1. AyushDubey23 commented on Oct 23, 2026

    @AyushDubey23

    This behavior is expected under the current packaging design.

    Playwright for Python publishes only pre-built platform wheels (8 wheels per release) because each wheel bundles the required Node.js driver binary. It does not publish a source distribution (sdist) or a pure Python wheel (py3-none-any.whl).

    When installer.no-binary is set to :all: in Poetry or --no-binary :all: in pip, the package manager rejects all binary wheels and looks for an sdist. Because no sdist exists on PyPI, installation fails.

    Supporting this workflow would require playwright-python to publish an additional source distribution or a platform-independent wheel that detects and uses a system-installed Node.js runtime. As noted in microsoft/playwright-python#3036, this is currently a feature request rather than a bug.

    Workarounds:

    1. Exempt playwright from the no-binary policy in your package manager configuration.
    2. On Arch Linux, install the distribution package via pacman -S python-playwright (which uses system Node.js).
  2. dcrousso commented on Oct 23, 2026

    @dcrousso
    Contributor

    Hi, the Playwright bot looked into this on my behalf by checking the published package metadata and source.

    This is a Python packaging feature request. Both 1.58.0 and 1.64.1 publish eight platform wheels and no source distribution, so Poetry correctly rejects every available artifact under installer.no-binary=:all:.

    Using system Node.js is already supported through PLAYWRIGHT_NODEJS_PATH, including in 1.58.0: https://playwright.dev/python/docs/browsers#using-a-pre-installed-nodejs. This selects the runtime but does not remove the executable bundled in the installed wheel.

    Your request therefore has two parts: avoiding bundled Node.js and supporting source-only installation. A platform-independent wheel would address the first, but Poetry would still reject it under this policy. Supporting both requires a source distribution whose build retains the matching JavaScript driver without bundling Node.js.

    This is the packaging decision raised in the earlier response: microsoft/playwright-python#3036 (comment). This issue is the appropriate place to collect feedback.

    Only source and metadata were inspected. No installation or runtime reproduction was performed.

    Investigated locally by the Playwright bot

  3. github-actions commented on Oct 28, 2026

    @github-actions
  4. github-actions commented on Oct 28, 2026

    @github-actions
    Contributor

    Hi, I'm the Playwright bot. I reviewed microsoft/playwright-python#3295 and its CI results.

    The approach addresses the missing source distribution, but the current PR has two confirmed CI failures and an installation-test gap. I did not find evidence that it changes normal installation on a supported platform when a matching wheel of the same version is available. The broader change is that a source install can now succeed without providing a working runtime.

    Problems in the current PR
    • Existing wheel jobs now fail. They build only a wheel, then run all of tests/test_installation.py. The new test_install_sdist assumes a .tar.gz exists and raises IndexError. This is visible in the Linux Chromium job. The wheel and source tests need separate selection, or both artifacts must be prepared.
    • The new source-distribution job never reaches its test. build --sdist creates the driver ZIP but does not extract it into the editable checkout. The following python -m playwright install-deps chromium therefore fails with Cannot find module .../playwright/driver/package/cli.js, even with PLAYWRIGHT_NODEJS_PATH set. See the source-distribution job.
    • The successful CLI check can use the checkout instead of the installed package. _run_client() runs the virtual environment's python -m playwright without changing the working directory. From the repository root, Python imports the checkout first. The earlier error checks correctly use cwd=tmp_path; the successful CLI invocation needs the same isolation. The separate client script does use the installed package, so this is specifically a CLI coverage gap.
    Compatibility and maintenance concerns

    Publishing an sdist is not limited to users who explicitly request source-only installation. If there is no compatible wheel, an ordinary installer can now select it automatically. Also, a newer sdist can beat an older compatible wheel. Such an install will require PLAYWRIGHT_NODEJS_PATH even when node is already on PATH; the PR intentionally does not discover it automatically.

    Likewise, pip wheel or an internal package mirror can distribute the resulting py3-none-any wheel to supported machines without bundled Node.js. This is not a problem with the wheel tag itself, but it means artifacts with the same package name and version have different runtime requirements. User-facing documentation should describe this difference, including that the environment variable must reach both CLI and API processes. The PR currently updates contributor instructions, not installation documentation.

    Removing Node.js does not extend browser support to every platform accepted by the Python package. For example, the existing Firefox/WebKit restriction on musl-based Linux remains. The external Node.js runtime also has its own update requirements outside the Python dependency lock. The pinned driver requires Node.js 20 or newer and already checks that minimum; a second version check is not needed here.

    Finally, the new test installs a local tarball with normal pip settings. It does not exercise Poetry's reported installer.no-binary=:all: workflow or source-only installation of the build dependencies. Those paths remain unverified.

    Evidence and limits

    Reviewed head: 7bcf5199266e97cdab88064f4c6d1ddf90d748d9. On Linux with Python 3.12 and pip 24.0, an independent pip candidate-selection probe confirmed that the same-version platform wheel wins over both the sdist and a universal wheel, but a newer sdist wins over an older platform wheel. A separate clean-venv probe confirmed the checkout-import problem.

    pip download --no-deps --no-cache-dir --no-binary=:all: --index-url https://pypi.org/simple playwright==1.58.0 reproduced the missing-source-candidate failure. I read the complete PR diff and the relevant build/runtime code and inspected the published CI logs; I did not build or execute the PR locally, run Poetry, or run browsers.

    Triaged on Linux by the Playwright bot - agent run

  5. github-actions commented on Oct 28, 2026

    @github-actions
  6. github-actions commented on Oct 28, 2026

    @github-actions
    Contributor

    Hi, I'm the Playwright bot. I checked the requested changes against the current Python PR.

    microsoft/playwright-python#3295 still needs the corrections from the earlier analysis. Its head is unchanged at 7bcf5199266e97cdab88064f4c6d1ddf90d748d9. I confirmed both CI failures directly in the Linux job logs: wheel jobs run the source test without a tarball, and the source job invokes the checkout CLI before extracting its JavaScript driver.

    This triage workflow can publish fixes only to microsoft/playwright, not update a Python PR or publish CI changes. I saved the concrete changes in the run summary; the PR itself was not changed.

    Required corrections and verification limits
    • Select tests/test_installation.py::test_install in wheel jobs and ::test_install_sdist in the source job.
    • Prepare an extracted driver before the source job runs install-deps. Building the sdist first and then a platform wheel is one option; the test must still install the tarball into its separate clean environment.
    • Set cwd=tmp_path for both subprocesses in _run_client(), so the successful CLI check cannot import the checkout.
    • Exercise source-only installation, including build dependencies, and verify Poetry's reported policy. Document external Node.js requirements for both CLI and API processes, automatic source fallback, and unchanged browser platform support.

    I read the full PR diff and current checks and inspected the wheel job log and source job log. This was a source and CI-log investigation on Linux, not a local installation or browser reproduction. The PR contains build and CI changes, which this workflow's third-party-code rules do not permit executing.

    Triaged on Linux by the Playwright bot - agent run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions