{"record":{"id":"5c31d72368247aad","repo":"pypa/pip","slug":"some-build-dependencies-for-requirement-are-miss","errorCode":null,"errorMessage":"Some build dependencies for {requirement} are missing: {missing}.","messagePattern":"Some build dependencies for (.+?) are missing: (.+?)\\.","errorType":"exception","errorClass":"InstallationError","httpStatus":null,"severity":"error","filePath":"src/pip/_internal/distributions/sdist.py","lineNumber":193,"sourceCode":"        )\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":175,"sourceCodeEnd":194,"githubUrl":"https://github.com/pypa/pip/blob/f399c3718970b1b0e2478dac5296eb62679a9b86/src/pip/_internal/distributions/sdist.py#L175-L194","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["If using --no-build-isolation, manually install all [build-system].requires listed in the project's pyproject.toml before retrying.","Drop --no-build-isolation and let pip create an isolated build environment that installs the declared build deps automatically.","Ensure network access and a correct --index-url so build dependencies can be fetched.","For offline installs, pre-populate the build environment or use --find-links to a local directory containing the build deps."],"exampleFix":"# before (missing build dep, no isolation)\npip install --no-build-isolation ./myproject\n# after (install the declared build dep first)\npip install setuptools-scm\npip install --no-build-isolation ./myproject\n# or let pip handle it\npip install ./myproject","handlingStrategy":"validation","validationCode":"try:\n    import tomllib  # py3.11+\nexcept ModuleNotFoundError:\n    import tomli as tomllib\n\ndef check_build_deps_available(project_dir: str, installed: set[str]) -> list[str]:\n    with open(f'{project_dir}/pyproject.toml', 'rb') as f:\n        data = tomllib.load(f)\n    requires = data.get('build-system', {}).get('requires', [])\n    missing = [r for r in requires if r.split('>=')[0].split('==')[0].strip() not in installed]\n    return missing\n","typeGuard":null,"tryCatchPattern":"import subprocess\ntry:\n    subprocess.run(['pip', 'install', '--no-build-isolation', project], check=True)\nexcept subprocess.CalledProcessError:\n    # missing build deps: install them, then retry\n    subprocess.run(['pip', 'install', 'setuptools', 'wheel', 'setuptools-scm'], check=True)\n    subprocess.run(['pip', 'install', '--no-build-isolation', project], check=True)\n","preventionTips":["Let pip use build isolation (default) so it installs declared build deps automatically.","If disabling isolation, pre-install everything in [build-system].requires.","Verify index/network access so build deps can be fetched."],"tags":["pip","build","dependencies","missing","pep517"],"backgroundTag":null,"analyzedSha":"f399c3718970b1b0e2478dac5296eb62679a9b86","analyzedAt":"2026-08-08T23:01:42.227Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}