{
  "id": "python/pip-requirement-already-satisfied-but-import-fails",
  "signature": "Requirement already satisfied: requests in ./venv/lib/python3.11/site-packages (2.31.0)\n\n>>> import requests\nModuleNotFoundError: No module named 'requests'",
  "signature_zh": "需求已满足：requests 位于 ./venv/lib/python3.11/site-packages (2.31.0)\n\n>>> import requests\nModuleNotFoundError: 没有名为 'requests' 的模块",
  "regex": "Requirement\\ already\\ satisfied:\\ requests\\ in\\ \\./venv/lib/python3\\.11/site\\-packages\\ \\(2\\.31\\.0\\)\\\n\\\n>>>\\ import\\ requests\\\nModuleNotFoundError:\\ No\\ module\\ named\\ 'requests'",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "pip installed into a different interpreter/site-packages than the one running the code (e.g. `pip` vs `python -m pip`, or a mismatched venv), so the import path does not include the install location.",
  "root_cause_type": "generic",
  "root_cause_zh": "pip 安装到了与运行代码不同的解释器/site-packages（例如 `pip` 与 `python -m pip` 不一致，或 venv 不匹配），因此导入路径不包含安装位置。",
  "versions": [
    {
      "version": "3.8",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.9",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.11",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.12",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Installs into the same wrong interpreter again.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Fragile and breaks when the environment changes.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Always install via the target interpreter: `python -m pip install requests`, and confirm with `python -c 'import sys; print(sys.executable)'`.",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Check which pip: `which pip` vs `python -m pip --version`; recreate the venv and activate it before installing.",
      "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-03-27",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}