Skip to content

Windows wheels since 3.3.1 require the Visual C++ redistributable #525

Description

@stickerdaniel

The Windows wheels published since 3.3.1 link the C++ runtime dynamically, so _greenlet.pyd imports MSVCP140.dll. Up to and including 3.3.0 it imported nothing beyond KERNEL32.dll and the Python DLL.

Import tables read from the published cp312-win_amd64 wheels:

release greenlet/_greenlet.cp312-win_amd64.pyd imports
3.2.4 KERNEL32.dll, python312.dll
3.3.0 KERNEL32.dll, python312.dll
3.3.1 the above plus MSVCP140.dll, VCRUNTIME140.dll, VCRUNTIME140_1.dll, api-ms-win-crt-*
3.3.2 through 3.5.4 same as 3.3.1

No Windows CPython distribution ships MSVCP140.dll. The python.org embeddable package and the python-build-standalone builds that uv installs both carry vcruntime140.dll and vcruntime140_1.dll and nothing further. On a machine without the Visual C++ 2015-2022 redistributable, importing greenlet therefore fails with

ImportError: DLL load failed while importing _greenlet: The specified module could not be found.

This looks like an oversight in #490. appveyor.yml set GREENLET_STATIC_RUNTIME: "1", which setup.py still honours by adding /MT. That file went away with the move to GHA, and the workflow step that replaced it does not set the variable.

It reaches people who never touch greenlet directly. playwright imports it unconditionally from _impl/_connection.py, including on the async-only path, so uvx-installed tools that depend on playwright fail at startup on Windows machines without the redistributable. That is how I ran into it: stickerdaniel/linkedin-mcp-server#688.

PR follows.

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