{"record":{"id":"d070071d2dfcf7f2","repo":"pypa/pip","slug":"path-not-found-cannot-resolve-group-option","errorCode":null,"errorMessage":"{path} not found. Cannot resolve '--group' option.","messagePattern":"(.+?) not found\\. Cannot resolve '--group' option\\.","errorType":"validation","errorClass":"InstallationError","httpStatus":null,"severity":"error","filePath":"src/pip/_internal/req/req_dependency_group.py","lineNumber":82,"sourceCode":"            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\n\n    return resolvers\n\n\ndef _load_pyproject(path: str) -> dict[str, Any]:\n    \"\"\"\n    This helper loads a pyproject.toml as TOML.\n\n    It raises an InstallationError if the operation fails.\n    \"\"\"\n    try:\n        with open(path, \"rb\") as fp:\n            return tomllib.load(fp)\n    except FileNotFoundError:\n        raise InstallationError(f\"{path} not found. Cannot resolve '--group' option.\")\n    except tomllib.TOMLDecodeError as e:\n        raise InstallationError(f\"Error parsing {path}: {e}\") from e\n    except OSError as e:\n        raise InstallationError(f\"Error reading {path}: {e}\") from e\n","sourceCodeStart":64,"sourceCodeEnd":87,"githubUrl":"https://github.com/pypa/pip/blob/f399c3718970b1b0e2478dac5296eb62679a9b86/src/pip/_internal/req/req_dependency_group.py#L64-L87","documentation":"The pyproject.toml file path specified for '--group' resolution does not exist on the filesystem. The _load_pyproject helper caught a FileNotFoundError and converted it to an InstallationError with a clear message.","triggerScenarios":"Running 'pip install --group dev' from a directory with no pyproject.toml, or specifying a custom pyproject.toml path that does not exist.","commonSituations":"Wrong working directory in CI or locally. Deleted or never-created pyproject.toml. Path typo. Running pip from a subdirectory of the project.","solutions":["Verify the file exists: 'ls pyproject.toml' or 'ls /path/to/pyproject.toml'","Run pip from the project root directory where pyproject.toml lives","Create a pyproject.toml if your project does not have one"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import os\n\ndef pyproject_exists(path: str) -> bool:\n    return os.path.isfile(path)\n\nif not pyproject_exists(\"pyproject.toml\"):\n    print(\"pyproject.toml not found — create it or check the path\")","typeGuard":"import os\n\ndef pyproject_file_exists(path: str) -> bool:\n    \"\"\"Type guard: True if the pyproject.toml file exists.\"\"\"\n    return os.path.isfile(path)","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 \"not found\" in str(e):\n        print(\"Create pyproject.toml or verify the working directory\")\n    else:\n        raise","preventionTips":["Verify the pyproject.toml path exists before using --group","Run pip from the project root directory","Create a pyproject.toml if the project does not have one"],"tags":["pip","dependency-groups","pep735","file-not-found","pyproject"],"backgroundTag":null,"analyzedSha":"f399c3718970b1b0e2478dac5296eb62679a9b86","analyzedAt":"2026-08-08T23:01:42.227Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}