{
  "id": "python/pip-venv-without-pip",
  "signature": "No module named pip\n\n# after: python -m venv .venv && source .venv/bin/activate && pip install requests",
  "signature_zh": "没有名为 pip 的模块\n\n# 在：python -m venv .venv && source .venv/bin/activate && pip install requests 之后",
  "regex": "No\\ module\\ named\\ pip\\\n\\\n\\#\\ after:\\ python\\ \\-m\\ venv\\ \\.venv\\ \\&\\&\\ source\\ \\.venv/bin/activate\\ \\&\\&\\ pip\\ install\\ requests",
  "domain": "python",
  "category": "install_error",
  "subcategory": null,
  "root_cause": "The venv was created with --without-pip, or ensurepip is unavailable (Debian's python3-venv split package), so the new environment has no pip.",
  "root_cause_type": "generic",
  "root_cause_zh": "venv 使用 --without-pip 创建，或 ensurepip 不可用（Debian 的 python3-venv 分离包），因此新环境没有 pip。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "pip is the thing that is missing; the command cannot run.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Mixes system and venv paths, leading to subtle import and shebang issues.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "python -m ensurepip --upgrade\npython -m pip install --upgrade pip",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.97,
      "how": "sudo apt install python3-venv python3-pip\nrm -rf .venv\npython3 -m venv .venv\nsource .venv/bin/activate\npython -m pip install requests",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-07-25",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}