pypa/pip · error · InstallationError

Some build dependencies for

Error message

Some build dependencies for {requirement} conflict with {conflicting_with}: {description}.

What it means

Raised by SourceDistribution._raise_conflicts() when check_requirements() reports that one or more build dependencies declared by the project conflict with requirements already satisfied in the build environment. This fires during prepare_distribution_metadata for both PEP 517/518 static build-system requirements and dynamically-requested build requirements, and also for backend dependency checks. The message lists each 'installed is incompatible with wanted' pair.

Solutions

  1. Upgrade pip to the latest version, which has improved conflict resolution for build dependencies.
  2. If using --no-build-isolation, align your environment's build tools to the versions the project's pyproject.toml requires.
  3. Pin a compatible version of the failing package that has relaxed build constraints, or install from a prebuilt wheel (`--prefer-binary`).
  4. Inspect the project's pyproject.toml [build-system].requires and resolve the version overlap manually (e.g. `pip install 'setuptools<60'` into the build env).
  5. If you maintain the package, widen the version constraints in build-system.requires.

Example fix

# before (build-isolation conflict)
pip install problematic-pkg
# after (install compatible build deps in current env, disable isolation)
pip install 'setuptools<60' wheel
pip install --no-build-isolation problematic-pkg
Defensive patterns

Strategy: fallback

Validate before calling

def choose_install_strategy(pkg: str, build_requires_conflict: bool) -> list[str]:
    if build_requires_conflict:
        return ['pip', 'install', '--prefer-binary', pkg]
    return ['pip', 'install', pkg]

Try / catch

import subprocess
try:
    subprocess.run(['pip', 'install', pkg], check=True)
except subprocess.CalledProcessError:
    # build-dep conflict: try prebuilt wheel, then no-build-isolation
    subprocess.run(['pip', 'install', '--prefer-binary', pkg], check=True)

Prevention

When it happens

Trigger: Installing a package whose pyproject.toml build-system.requires pins a version of a build tool (e.g. setuptools<60) that conflicts with what is already in the (isolated or non-isolated) build environment; backend-declared dynamic requirements that conflict with the static ones; using --no-build-isolation where the ambient environment has incompatible versions.

Common situations: A package constraining setuptools/wheel/poetry-core to a version incompatible with what's installed; dependency resolver picking build deps that mutually exclude each other; mixing a project's build deps with a constrained base environment; upgrading a build tool that breaks an older package's build constraints.

Related errors


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

Appendix: source

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

                missing, "normal", kind="backend dependencies", for_req=self.req
            )

    def _raise_conflicts(
        self, conflicting_with: str, conflicting_reqs: set[tuple[str, str]]
    ) -> None:
        format_string = (
            "Some build dependencies for {requirement} "
            "conflict with {conflicting_with}: {description}."
        )
        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)