{
  "id": "P110",
  "slug": "pip-externally-managed-environment-sudo-pip-install-pep-668-distro-python-documentation",
  "status": "search-observed",
  "product": "pip / distro Python",
  "family": "OS-managed environment",
  "canonical_url": "https://gitdocs.org/fix/pip-externally-managed-environment-sudo-pip-install-pep-668-distro-python-documentation",
  "query_alias_url": "https://gitdocs.org/q/pip-externally-managed-environment-sudo-pip-install-pep-668-distro-python-documentation",
  "markdown_url": "https://gitdocs.org/fix/pip-externally-managed-environment-sudo-pip-install-pep-668-distro-python-documentation.md",
  "json_url": "https://gitdocs.org/api/fixes/pip-externally-managed-environment-sudo-pip-install-pep-668-distro-python-documentation.json",
  "canonical_query": "pip externally managed environment sudo pip install PEP 668 distro Python documentation",
  "observed_codex_queries": [
    "pip externally managed environment sudo pip install PEP 668 distro Python documentation",
    "site:pip.pypa.io externally managed environment --break-system-packages",
    "https://pip.pypa.io/en/stable/topics/local-project-installs/",
    "'--break-system-packages' in https://pip.pypa.io/en/stable/cli/pip_install/"
  ],
  "organic_dependency_search_count": 4,
  "affected_versions": "",
  "exact_errors": [],
  "diagnosis": "The same pip command works in some images and is forbidden in externally managed distributions; the governing marker is outside the project.",
  "before": "",
  "after": "",
  "verification": "Verifier checks an isolated environment or distro-appropriate install and ensures system packages are not overwritten. Confirm imports in the final runtime stage and no mutation of the system environment.",
  "unsafe_fixes": [
    "Changing local code without checking the current external contract.",
    "Retrying the same install, build, or API call with no version/source change.",
    "Applying a broad unsafe bypass when a narrow compatibility fix is available."
  ],
  "last_verified_at": "2026-06-25",
  "neutral_validation": {
    "organic_search_observed": true,
    "organic_strict_pass": true,
    "no_web_counterfactual_run": false,
    "no_web_strict_pass": null,
    "search_necessity_under_fixture": null,
    "no_web_oracle_note": "Observed query evidence is separated from necessity proof; no-web and stale-contract counterfactuals should be tracked separately."
  },
  "source_trail": [
    {
      "url": "https://peps.python.org/pep-0668/",
      "label": "PEP 668 externally managed environments"
    },
    {
      "url": "https://pip.pypa.io/en/stable/topics/local-project-installs/",
      "label": "Official reference opened by Codex"
    }
  ],
  "source_github_links": []
}
