pip Error “Microsoft Visual C++ 14.0 or greater is required”: Solutions
Why pip asks for Microsoft Visual C++ when installing a Python library and how to fix the error, often without installing any compiler.
You are installing a Python library with pip and, after a few lines of progress, the terminal fills up with red messages that end more or less like this:
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/
[end of output]
ERROR: Failed building wheel for library-name
Failed to build library-name
The message suggests installing Microsoft's C++ development tools: several gigabytes of software. In most cases, however, that is not the best solution. In this article we look at what the error really means, how to find its cause and how to fix it, starting with the simplest solutions.
What the error means
Many Python libraries contain parts written in the C language, to make them faster. That code has to be compiled, that is, turned into a program the computer can run. Library authors usually do this for you and publish ready-made packages called wheels on PyPI, the official archive of Python libraries.
The key point is that a wheel with compiled code only works for:
- a specific Python version, for example 3.14;
- a specific operating system and processor, for example 64-bit Windows.
When pip cannot find a wheel suited to your combination, it downloads the source code and tries to compile it itself. On Windows that requires Microsoft's C++ compiler: if it is missing, the error appears. In other words, the message does not mean “you are missing Visual C++”, but “there is no ready-made package for your configuration”.
The most common causes
- A Python version that is too recent. This is the most frequent cause. When a new version comes out, such as Python 3.15 on 9 October 2026, many libraries take weeks or months to publish compatible wheels. Meanwhile, pip tries to compile.
- A Python version that is too old. The opposite case: recent versions of a library no longer publish wheels for unsupported Python versions.
- An old library version, or one pinned in the project. A
requirements.txtfile that forces an outdated version of a library may have no wheels for your Python. - A less common processor or system, for example Windows on ARM or 32-bit Python.
- An indirect dependency. Sometimes the library that fails is not the one you asked for, but one it pulls in.
How to find out which library is failing
Read the output from the top: look for lines that start with Building wheel for or Failed building wheel for. The name that appears there is the library pip is trying to compile. Often it is not the one you installed: for example, asking for uvicorn[standard] makes pip install other optional libraries too, and one of these may be the one without a wheel.
Then check which Python version you are using:
python --version
How to check whether a wheel exists for your Python
Open the library's page on pypi.org and click Download files. The file names contain codes indicating which configuration they were built for. For example:
libraryname-1.2.0-cp314-cp314-win_amd64.whl
cp314means CPython 3.14, that is, Python 3.14;win_amd64means 64-bit Windows.
If the list has no file for your version (for example cp315 if you use Python 3.15), you have found the cause.
Solution 1: update pip
This is the first thing to do, because it only takes a few seconds: an old version of pip may not recognise the most recent wheels.
python -m pip install --upgrade pip
Then repeat the installation of the library.
Solution 2: use a supported Python version
If the library does not yet have wheels for your Python version, the cleanest solution is to use the previous version. With the Python Install Manager on Windows, a few commands are enough:
py install 3.14
Then recreate the project's virtual environment with that version. From the project folder:
rmdir /s /q .venv
py -V:3.14 -m venv .venv
.venv\Scripts\activate
python -m pip install -r requirements.txt
The first command deletes the old environment; the others recreate it with Python 3.14 and reinstall the libraries. You can keep both Python versions installed and use the newer one in your other projects.
This is the right solution in the vast majority of cases: within a few minutes you fix the problem without installing anything heavy.
Solution 3: update the library
If the project specifies an exact version of the library, for example libraryname==1.0.3 in the requirements.txt file, try a newer version, which may have wheels for your Python:
python -m pip install --upgrade libraryname
Then check that your program still works: a new major version of a library may introduce changes.
Solution 4: avoid optional dependencies
Some libraries offer optional “extras”, shown in square brackets, such as uvicorn[standard]. If the failing library comes from one of these extras and you do not need it, install the base version:
python -m pip install uvicorn
Solution 5: tell pip to use wheels only
With this option pip never tries to compile: if there is a version of the library with a compatible wheel, it chooses that one; otherwise it stops straight away with a clear message instead of a long compilation error.
python -m pip install --only-binary :all: libraryname
It is also useful as a diagnostic tool: it tells you for certain whether the problem is a missing wheel.
Solution 6: install the Microsoft C++ Build Tools
If none of the previous solutions works, for example because you really need a library that does not publish wheels for Windows, you can install the compiler. This is the solution the error message suggests:
- Download Microsoft C++ Build Tools from the page given in the error.
- During installation select the Desktop development with C++ workload, which includes the MSVC compiler and the Windows SDK.
- When it finishes, restart the computer, open a new terminal, activate the virtual environment and repeat the installation.
Bear in mind that the installation takes up several gigabytes and that some libraries require, in addition to the compiler, other specific components listed in their documentation.
What about Linux?
On Linux the error looks different, usually with messages about gcc or files such as Python.h, but the cause is the same. Solutions 1–5 apply here too. If you do need to compile, on Ubuntu and Debian install the basic tools:
sudo apt install build-essential python3-dev
In short
- The error means there is no ready-made package for your combination of Python and operating system.
- The most frequent cause is a Python version that is too recent.
- The quickest solution is to update pip and, if that is not enough, use the previous Python version in a new virtual environment.
- The Build Tools are the last resort, not the first.
Official sources
Share
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Angry
0
Sad
0
Wow
0