Failed building wheel Python Origin: Application & API Last updated 13 Oct 2026

error: subprocess-exited-with-error / Failed building wheel for x

pip had to compile a package from source and the build failed — missing compiler, headers or system libraries.

Exact message you may see Failed building wheel forMicrosoft Visual C++ 14.0 or greater is required
Seen on: Python

Meaning

When no prebuilt wheel exists for your Python/OS, pip builds from source. That needs a C compiler and library headers (e.g. libpq-dev for psycopg2, Microsoft C++ Build Tools on Windows).

Common causes

  • No prebuilt wheel for a brand-new Python version
  • Missing build tools (gcc, MSVC)
  • Missing system headers (libpq-dev, libffi-dev, python3-dev)
  • Old pip unable to use modern wheels

⚡ Quick fix

  1. Upgrade pip/setuptools/wheel first
  2. Use a supported Python version with wheels
  3. Install build deps (build-essential python3-dev + library -dev packages)
  4. Prefer binary packages (psycopg2-binary)

Detailed fix by platform

Linux

  1. sudo apt install build-essential python3-dev libpq-dev && python -m pip install -U pip wheel setuptools

How to diagnose

  1. Package — Which package failed?
  2. Log — First "error:" line in the build output

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

COPY failed — COPY failed: file not found in build context / "/app/x": not found (Docker)COPY failedERR_OSSL_EVP_UNSUPPORTED — Error: error:0308010C:digital envelope routines::unsupported (Node.js)ERR_OSSL_EVP_UNSUPPOR…externally-managed-environment — error: externally-managed-environment (Python)externally-managed-en…Gradle wrapper main class — Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain (Java)Gradle wrapper main c…gyp ERR! — gyp ERR! build error / node-gyp rebuild failed (npm)gyp ERR!lookup registry-1.docker.io: no such host — dial tcp: lookup registry-1.docker.io: no such host / Temporary failure in name resolution during docker build (Docker)lookup registry-1.doc…MSB3027 — error MSB3027: Could not copy "obj\...\App.dll" to "bin\...\App.dll". Exceeded retry count of 10. The file is locked by: "App (1234)" (.NET)MSB3027NETSDK1045 — error NETSDK1045: The current .NET SDK does not support targeting .NET 8.0. Either target .NET 7.0 or lower, or use a version of the .NET SDK that supports .NET 8.0 (.NET)NETSDK1045Failed bu…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.