Skip to content

Windows: uv sync fails building cffi (MSVC required, no prebuilt wheel used) #14191

@Liberaether

Description

@Liberaether

Environment:

  • OS: Windows 11 (PowerShell)
  • Python: 3.14.x
  • Package manager: uv

Problem:
Running uv sync on Windows fails when building cffi==1.17.1.

From the dependency chain:

  • toolbox depends on cryptography (v45.0.4)
  • cryptography depends on cffi
  • uv does not pick up a prebuilt Windows wheel for cffi
  • instead, it falls back to building cffi from source

During the build step, the process fails with the following error:

Microsoft Visual C++ 14.0 or greater is required

The failure happens inside setuptools.build_meta.build_wheel,
specifically during MSVC environment detection in distutils.

Steps to reproduce:

  1. On a Windows machine without Microsoft C++ Build Tools installed
  2. Run:
    uv sync
  3. The build fails while compiling cffi

Expected behavior:

  • On Windows, a precompiled wheel for cffi should be used if available
  • Or the documentation should clearly state that MSVC Build Tools are required on Windows

Suggestions:

  • Ensure Windows wheels for cffi are properly resolved when using uv
  • Or document the Windows build requirements explicitly in the README / install guide

This issue is easy to hit on fresh Windows environments or CI machines.
Sharing this for awareness and possible improvement. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stalewaiting-on-reporterIssue is waiting on a reply from the reporter. It will be automatically cloesd if there is no reply.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions