pip "error: subprocess-exited-with-error" - Find the Real Cause
subprocess-exited-with-error is pip’s generic banner for "a build or metadata subprocess returned non-zero." The actual failure - a compiler error, missing module, or bad setup script - is in the captured output just above it.
What this error means
pip prints a boxed "× ... did not run successfully" section with captured output, the note "This error originates from a subprocess, and is likely not a problem with pip," then error: subprocess-exited-with-error. The wrapper is the same regardless of the real cause.
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [8 lines of output]
...
ModuleNotFoundError: No module named 'Cython'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-errorCommon causes
A build dependency is missing
The package’s build step imports something not provided in the isolated build env (Cython, numpy, a C library), so the subprocess exits non-zero.
A native compile or setup.py failure
A compiler error, missing header, or a setup.py that raises at import time makes the build subprocess fail. pip only reports the wrapper, not the root cause.
How to fix it
Read the captured output, not the wrapper
- Find the first real
error:/ModuleNotFoundError/fatal error:line inside the box-drawing section. - Treat that specific line as the actual problem and fix it (missing build dep, header, or toolchain).
- Ignore the "not a problem with pip" note - it is generic boilerplate.
Provide the missing build dependency
If the build needs Cython/numpy in isolation, add them to the project’s [build-system] requires, or pre-install and disable isolation.
python -m pip install --upgrade pip setuptools wheel
pip install "cython" "numpy"
pip install --no-build-isolation <package>Re-run verbosely if output was truncated
pip install -v <package>How to prevent it
- Declare a complete
[build-system] requiresso build deps are present. - Upgrade pip/setuptools/wheel early so build isolation behaves.
- Prefer wheels in CI so the build subprocess is skipped entirely.