{"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":189,"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":171,"sourceCodeEnd":190,"githubUrl":"https://github.com/pypa/pip/blob/d7d0d0a39494e28ec1c407bd0680e4a4d1067791/src/pip/_internal/distributions/sdist.py#L171-L190","documentation":"InstallationError raised by SourceDistribution._raise_missing_reqs when check_requirements finds that build dependencies declared by the project are entirely absent from the build environment. Unlike conflicts (present-but-wrong), here the packages are not installed at all, so the build cannot proceed.","triggerScenarios":"Raised after prepare_distribution_metadata calls check_build_deps (when --check-build-deps / default behavior) and self.req.build_env.check_requirements(pyproject_requires) returns a non-empty missing set. Common with --no-build-isolation when the host interpreter lacks setuptools/wheel/cython/etc. that [build-system].requires lists.","commonSituations":"Building an sdist with --no-build-isolation in a slim container/CI image missing build tools; a pyproject.toml that adds a build dep (e.g. flit-core, poetry-core) the environment doesn't have; --target/--prefix installs into an environment without the build backend.","solutions":["Install each listed missing requirement into the active environment: pip install <each missing name>.","Drop --no-build-isolation so pip provisions the declared [build-system].requires in an isolated venv.","Ensure pyproject.toml [build-system].requires is correct and not referencing a package you don't actually need.","In CI, pre-install the build toolchain (setuptools wheel packaging) in the base image."],"exampleFix":"# before\npip install --no-build-isolation .\n# error: missing setuptools>=64, wheel\n\n# after\npip install \"setuptools>=64\" wheel\npip install --no-build-isolation .\n# or simply\npip install .","handlingStrategy":"validation","validationCode":"import tomllib, importlib\nwith open('pyproject.toml','rb') as f: data=tomllib.load(f)\nmissing = [r for r in data.get('build-system',{}).get('requires',[])\n           if importlib.util.find_spec(r.split('[',1)[0].replace('-','_')) is None]\nif missing:\n    print('install first:', missing)","typeGuard":"def has_build_deps(requires: list[str]) -> bool:\n    import importlib.util\n    for r in requires:\n        name = r.split('[',1)[0].split('>')[0].split('<')[0].replace('-','_').strip()\n        if importlib.util.find_spec(name) is None:\n            return False\n    return True","tryCatchPattern":"from pip._internal.exceptions import InstallationError\ntry:\n    dist.prepare_distribution_metadata(env_installer, isolation, True, True)\nexcept InstallationError as e:\n    if 'are missing' in str(e):\n        missing = parse_missing(e)  # extract names\n        subprocess.check_call([sys.executable,'-m','pip','install',*missing])","preventionTips":["Pre-install [build-system].requires when using --no-build-isolation.","Default to build isolation unless you have a reason not to.","List build deps explicitly and accurately in pyproject.toml.","Bake build toolchain into CI images."],"tags":["build","pep517","build-isolation","dependencies","missing-deps"],"analyzedSha":"d7d0d0a39494e28ec1c407bd0680e4a4d1067791","analyzedAt":"2026-08-04T20:55:04.259Z","schemaVersion":2}