{"record":{"id":"a66ceaa9cd648dad","repo":"pypa/pip","slug":"some-build-dependencies-for-requirement-conflict","errorCode":null,"errorMessage":"Some build dependencies for {requirement} conflict with {conflicting_with}: {description}.","messagePattern":"Some build dependencies for (.+?) conflict with (.+?): (.+?)\\.","errorType":"exception","errorClass":"InstallationError","httpStatus":null,"severity":"error","filePath":"src/pip/_internal/distributions/sdist.py","lineNumber":184,"sourceCode":"                missing, \"normal\", kind=\"backend dependencies\", for_req=self.req\n            )\n\n    def _raise_conflicts(\n        self, conflicting_with: str, conflicting_reqs: set[tuple[str, str]]\n    ) -> None:\n        format_string = (\n            \"Some build dependencies for {requirement} \"\n            \"conflict with {conflicting_with}: {description}.\"\n        )\n        error_message = format_string.format(\n            requirement=self.req,\n            conflicting_with=conflicting_with,\n            description=\", \".join(\n                f\"{installed} is incompatible with {wanted}\"\n                for installed, wanted in sorted(conflicting_reqs)\n            ),\n        )\n        raise InstallationError(error_message)\n\n    def _raise_missing_reqs(self, missing: set[str]) -> None:\n        format_string = (\n            \"Some build dependencies for {requirement} are missing: {missing}.\"\n        )\n        error_message = format_string.format(\n            requirement=self.req, missing=\", \".join(map(repr, sorted(missing)))\n        )\n        raise InstallationError(error_message)\n","sourceCodeStart":166,"sourceCodeEnd":194,"githubUrl":"https://github.com/pypa/pip/blob/f399c3718970b1b0e2478dac5296eb62679a9b86/src/pip/_internal/distributions/sdist.py#L166-L194","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Upgrade pip to the latest version, which has improved conflict resolution for build dependencies.","If using --no-build-isolation, align your environment's build tools to the versions the project's pyproject.toml requires.","Pin a compatible version of the failing package that has relaxed build constraints, or install from a prebuilt wheel (`--prefer-binary`).","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).","If you maintain the package, widen the version constraints in build-system.requires."],"exampleFix":"# before (build-isolation conflict)\npip install problematic-pkg\n# after (install compatible build deps in current env, disable isolation)\npip install 'setuptools<60' wheel\npip install --no-build-isolation problematic-pkg","handlingStrategy":"fallback","validationCode":"def choose_install_strategy(pkg: str, build_requires_conflict: bool) -> list[str]:\n    if build_requires_conflict:\n        return ['pip', 'install', '--prefer-binary', pkg]\n    return ['pip', 'install', pkg]\n","typeGuard":null,"tryCatchPattern":"import subprocess\ntry:\n    subprocess.run(['pip', 'install', pkg], check=True)\nexcept subprocess.CalledProcessError:\n    # build-dep conflict: try prebuilt wheel, then no-build-isolation\n    subprocess.run(['pip', 'install', '--prefer-binary', pkg], check=True)\n","preventionTips":["Keep pip updated for better build-dep conflict resolution.","Use --prefer-binary to avoid source builds when wheels exist.","With --no-build-isolation, ensure the environment matches pyproject.toml build-system.requires."],"tags":["pip","build","dependencies","conflict","pep517"],"backgroundTag":null,"analyzedSha":"f399c3718970b1b0e2478dac5296eb62679a9b86","analyzedAt":"2026-08-08T23:01:42.227Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}