pip "Microsoft Visual C++ 14.0 or greater is required" in CI
On a Windows runner, a package with a C extension had no prebuilt wheel and pip tried to compile it - but the MSVC build tools are not installed. Most CI is Linux, where this does not occur; it is specific to Windows source builds.
What this error means
On a Windows job, a wheel build fails with error: Microsoft Visual C++ 14.0 or greater is required, pointing to the Build Tools download. Linux runners building the same package instead need gcc, not MSVC.
error: Microsoft Visual C++ 14.0 or greater is required. Get it with
"Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
error: command 'cl.exe' failedCommon causes
No prebuilt wheel on Windows
The package ships wheels for some platforms but not this Windows/Python combination, so pip falls back to compiling with MSVC, which is absent.
MSVC Build Tools not installed on the runner
A bare Windows image has no C++ compiler. cl.exe is missing, so the source build cannot run.
How to fix it
Prefer a wheel or run on Linux
Most CI runs on Linux. If you only need the package built, a Linux runner with a manylinux wheel avoids MSVC entirely.
python -m pip install --upgrade pip
pip install --only-binary :all: <package>Install MSVC Build Tools on Windows runners
If you must build on Windows, install the C++ Build Tools (GitHub-hosted windows-latest already includes them; bare images do not).
choco install visualstudio2022buildtools --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools"How to prevent it
- Prefer Linux runners with manylinux wheels for native deps.
- Use GitHub-hosted Windows images (Build Tools preinstalled) when Windows is required.
- Keep pip current so it selects available Windows wheels.