{
  "id": "python/pip-module-not-found-after-install",
  "signature": "ModuleNotFoundError: No module named 'requests'",
  "signature_zh": "ModuleNotFoundError: 没有名为 'requests' 的模块",
  "regex": "ModuleNotFoundError:\\ No\\ module\\ named\\ 'requests'",
  "domain": "python",
  "category": "module_error",
  "subcategory": null,
  "root_cause": "Package was installed into a different Python interpreter/site-packages than the one running the script (e.g., pip vs python3, or a virtualenv not activated).",
  "root_cause_type": "generic",
  "root_cause_zh": "包被安装到了与运行脚本不同的 Python 解释器/site-packages 中（例如 pip 与 python3 不同，或虚拟环境未激活）。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Installs into the system Python, not the active interpreter, worsening the mismatch.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Does not fix the interpreter mismatch and breaks when environments change.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "python -m pip install requests  # use the same python that runs your script",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "python -c \"import sys; print(sys.executable, sys.path)\"\npython -m pip show 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-03-12",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}