{"record":{"id":"fd7d6b14e0d018cd","repo":"pypa/pip","slug":"dependency-groups-resolution-failed-for-groupn","errorCode":null,"errorMessage":"[dependency-groups] resolution failed for '{groupname}' from '{path}': {'; '.join(messages)}","messagePattern":"\\[dependency-groups\\] resolution failed for '(.+?)' from '(.+?)': (.+?)","errorType":"exception","errorClass":"InstallationError","httpStatus":null,"severity":"error","filePath":"src/pip/_internal/req/req_dependency_group.py","lineNumber":35,"sourceCode":"    resolvers = _build_resolvers(path for (path, _) in groups)\n    return list(_resolve_all_groups(resolvers, groups))\n\n\ndef _resolve_all_groups(\n    resolvers: dict[str, DependencyGroupResolver], groups: list[tuple[str, str]]\n) -> Iterator[str]:\n    \"\"\"\n    Run all resolution, converting any error from `DependencyGroupResolver` into\n    an InstallationError.\n    \"\"\"\n    for path, groupname in groups:\n        resolver = resolvers[path]\n        try:\n            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\"]","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/pypa/pip/blob/f399c3718970b1b0e2478dac5296eb62679a9b86/src/pip/_internal/req/req_dependency_group.py#L17-L53","documentation":"pip's dependency-group resolver (DependencyGroupResolver.resolve()) raised an ExceptionGroup while resolving a specific group name. This happens when the group contains invalid PEP 508 entries or references another group (via include-group) that does not exist. All sub-exception messages are joined into one InstallationError.","triggerScenarios":"Running 'pip install --group mygroup' where mygroup contains an entry like 'nonexistent-group' (referenced via include-group but not defined), or contains a string that is not valid PEP 508. The resolver collects all failures into an ExceptionGroup.","commonSituations":"Group references with typos. Circular group references. Entries that are plain strings with bad syntax. Groups defined in one pyproject.toml but referenced from another where they don't exist.","solutions":["Read the joined messages in the error — each sub-exception names the specific failing entry","Verify every include-group reference points to a group that exists in the same [dependency-groups] table","Validate each string entry with packaging.requirements.Requirement() to find the malformed one","Check for circular references between groups (A includes B, B includes A)"],"exampleFix":"# before — pyproject.toml\n[dependency-groups]\ntest = [\"pytest\", { include-group = \"lint-nonexistent\" }]\n\n# after\n[dependency-groups]\ntest = [\"pytest\", { include-group = \"lint\" }]\nlint = [\"ruff\"]","handlingStrategy":"try-catch","validationCode":"from pip._vendor.packaging.dependency_groups import DependencyGroupResolver\nfrom pip._vendor.packaging.errors import ExceptionGroup\n\ndef validate_group_resolution(raw_groups: dict, groupname: str) -> bool:\n    try:\n        resolver = DependencyGroupResolver(raw_groups)\n        list(resolver.resolve(groupname))\n        return True\n    except Exception:\n        return False","typeGuard":"from pip._vendor.packaging.dependency_groups import DependencyGroupResolver\n\ndef is_resolvable_group(raw_groups: dict, groupname: str) -> bool:\n    \"\"\"Type guard: True if the group resolves without error.\"\"\"\n    try:\n        resolver = DependencyGroupResolver(raw_groups)\n        list(resolver.resolve(groupname))\n        return True\n    except Exception:\n        return False","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\", groupname)])\nexcept InstallationError as e:\n    logger.error(\"Group resolution failed: %s\", e)\n    # inspect joined messages for specifics, fix entries, retry","preventionTips":["Verify all include-group references point to groups that exist in the same table","Validate each group entry with packaging.requirements.Requirement() before relying on it","Check for circular group references (A -> B -> A)"],"tags":["pip","dependency-groups","pep735","pyproject","resolver"],"backgroundTag":null,"analyzedSha":"f399c3718970b1b0e2478dac5296eb62679a9b86","analyzedAt":"2026-08-08T23:01:42.227Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}