pypa/pip · error · InstallationError

Some build dependencies for

Error message

Some build dependencies for {requirement} are missing: {missing}.

What it means

Raised by SourceDistribution._raise_missing_reqs() when check_requirements() (called with check_build_deps=True) finds that one or more build dependencies declared in the project's pyproject.toml are not installed in the build environment. This only fires when build dependency checking is enabled and the project specifies a [build-system] table; the missing requirement names are listed.

Solutions

  1. If using --no-build-isolation, manually install all [build-system].requires listed in the project's pyproject.toml before retrying.
  2. Drop --no-build-isolation and let pip create an isolated build environment that installs the declared build deps automatically.
  3. Ensure network access and a correct --index-url so build dependencies can be fetched.
  4. For offline installs, pre-populate the build environment or use --find-links to a local directory containing the build deps.

Example fix

# before (missing build dep, no isolation)
pip install --no-build-isolation ./myproject
# after (install the declared build dep first)
pip install setuptools-scm
pip install --no-build-isolation ./myproject
# or let pip handle it
pip install ./myproject
Defensive patterns

Strategy: validation

Validate before calling

try:
    import tomllib  # py3.11+
except ModuleNotFoundError:
    import tomli as tomllib

def check_build_deps_available(project_dir: str, installed: set[str]) -> list[str]:
    with open(f'{project_dir}/pyproject.toml', 'rb') as f:
        data = tomllib.load(f)
    requires = data.get('build-system', {}).get('requires', [])
    missing = [r for r in requires if r.split('>=')[0].split('==')[0].strip() not in installed]
    return missing

Try / catch

import subprocess
try:
    subprocess.run(['pip', 'install', '--no-build-isolation', project], check=True)
except subprocess.CalledProcessError:
    # missing build deps: install them, then retry
    subprocess.run(['pip', 'install', 'setuptools', 'wheel', 'setuptools-scm'], check=True)
    subprocess.run(['pip', 'install', '--no-build-isolation', project], check=True)

Prevention

When it happens

Trigger: Installing a source distribution with --no-build-isolation (so pip uses the ambient environment) when that environment lacks a build dependency the project declares (e.g. the project needs `setuptools-scm` but it isn't installed). Also fires in isolated builds if the build dependency cannot be fetched (e.g. offline, index misconfigured).

Common situations: Building from source with --no-build-isolation in a minimal environment missing build tools; offline/air-gapped installs where build deps can't be downloaded; a project whose pyproject.toml declares a build dep not available on the configured index.

Related errors


AI-assisted analysis of pypa/pip@f399c37189 (2026-08-08). Data as JSON: /api/errors/5c31d72368247aad. Report an issue: GitHub.

Appendix: source

Thrown at src/pip/_internal/distributions/sdist.py:193

        )
        error_message = format_string.format(
            requirement=self.req,
            conflicting_with=conflicting_with,
            description=", ".join(
                f"{installed} is incompatible with {wanted}"
                for installed, wanted in sorted(conflicting_reqs)
            ),
        )
        raise InstallationError(error_message)

    def _raise_missing_reqs(self, missing: set[str]) -> None:
        format_string = (
            "Some build dependencies for {requirement} are missing: {missing}."
        )
        error_message = format_string.format(
            requirement=self.req, missing=", ".join(map(repr, sorted(missing)))
        )
        raise InstallationError(error_message)

View on GitHub (pinned to f399c37189)