{"record":{"id":"2a20bd7614aee708","repo":"pypa/pip","slug":"dependency-groups-table-was-missing-from-path","errorCode":null,"errorMessage":"[dependency-groups] table was missing from '{path}'. Cannot resolve '--group' option.","messagePattern":"\\[dependency-groups\\] table was missing from '(.+?)'\\. Cannot resolve '--group' option\\.","errorType":"validation","errorClass":"InstallationError","httpStatus":null,"severity":"error","filePath":"src/pip/_internal/req/req_dependency_group.py","lineNumber":49,"sourceCode":"            yield from (str(req) for req in resolver.resolve(groupname))\n        except ExceptionGroup as eg:\n            # Convert ExceptionGroup to a single InstallationError with all messages\n            messages = [str(e) for e in eg.exceptions]\n            raise InstallationError(\n                f\"[dependency-groups] resolution failed for '{groupname}' \"\n                f\"from '{path}': {'; '.join(messages)}\"\n            ) from eg\n\n\ndef _build_resolvers(paths: Iterable[str]) -> dict[str, Any]:\n    resolvers = {}\n    for path in paths:\n        if path in resolvers:\n            continue\n\n        pyproject = _load_pyproject(path)\n        if \"dependency-groups\" not in pyproject:\n            raise InstallationError(\n                f\"[dependency-groups] table was missing from '{path}'. \"\n                \"Cannot resolve '--group' option.\"\n            )\n        raw_dependency_groups = pyproject[\"dependency-groups\"]\n        if not isinstance(raw_dependency_groups, dict):\n            raise InstallationError(\n                f\"[dependency-groups] table was malformed in {path}. \"\n                \"Cannot resolve '--group' option.\"\n            )\n\n        try:\n            resolvers[path] = DependencyGroupResolver(raw_dependency_groups)\n        except ExceptionGroup as eg:\n            # Handle ExceptionGroup from resolver initialization\n            messages = [str(e) for e in eg.exceptions]\n            raise InstallationError(\n                f\"[dependency-groups] data was invalid in {path}: {'; '.join(messages)}\"\n            ) from eg","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/pypa/pip/blob/f399c3718970b1b0e2478dac5296eb62679a9b86/src/pip/_internal/req/req_dependency_group.py#L31-L67","documentation":"pip was asked to resolve a '--group' but the specified pyproject.toml does not contain a '[dependency-groups]' table at all. Without this table, there are no groups to resolve, so pip aborts early in _build_resolvers().","triggerScenarios":"Running 'pip install --group dev' in a project whose pyproject.toml has no [dependency-groups] section. The check 'if dependency-groups not in pyproject' fails.","commonSituations":"Project has not adopted PEP 735 dependency groups yet. Wrong pyproject.toml path was specified. The table was accidentally removed or renamed during editing.","solutions":["Add a [dependency-groups] table to your pyproject.toml with at least one group","Verify you are pointing at the correct pyproject.toml if using a custom path","Remove the --group flag if your project does not use dependency groups"],"exampleFix":"# before — pyproject.toml has no dependency-groups\n[project]\nname = \"mypackage\"\n\n# after\n[project]\nname = \"mypackage\"\n\n[dependency-groups]\ndev = [\"pytest\", \"ruff\"]","handlingStrategy":"validation","validationCode":"from pip._internal.utils.compat import tomllib\n\ndef has_dependency_groups_table(path: str) -> bool:\n    with open(path, \"rb\") as fp:\n        data = tomllib.load(fp)\n    return \"dependency-groups\" in data\n\nif not has_dependency_groups_table(\"pyproject.toml\"):\n    print(\"No [dependency-groups] table — add one or remove --group\")","typeGuard":"from pip._internal.utils.compat import tomllib\n\ndef has_dependency_groups(path: str) -> bool:\n    \"\"\"Type guard: True if pyproject.toml has a [dependency-groups] table.\"\"\"\n    with open(path, \"rb\") as fp:\n        return \"dependency-groups\" in tomllib.load(fp)","tryCatchPattern":"from pip._internal.exceptions import InstallationError\nfrom pip._internal.req.req_dependency_group import parse_dependency_groups\n\ntry:\n    reqs = parse_dependency_groups([(\"pyproject.toml\", \"dev\")])\nexcept InstallationError as e:\n    if \"table was missing\" in str(e):\n        print(\"Add a [dependency-groups] table to pyproject.toml\")\n    else:\n        raise","preventionTips":["Add a [dependency-groups] table before using --group","Validate pyproject.toml has the table in CI before invoking pip --group","Remove the --group flag if your project does not use dependency groups"],"tags":["pip","dependency-groups","pep735","pyproject","configuration"],"backgroundTag":null,"analyzedSha":"f399c3718970b1b0e2478dac5296eb62679a9b86","analyzedAt":"2026-08-08T23:01:42.227Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}