{
  "id": "python/pip-requirement-already-satisfied-wrong-python",
  "signature": "Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (1.21.5) but you have python 3.11 and numpy is not importable",
  "signature_zh": "需求已满足：numpy 位于 /usr/lib/python3/dist-packages (1.21.5)，但你使用 Python 3.11 且 numpy 无法导入",
  "regex": "Requirement\\ already\\ satisfied:\\ numpy\\ in\\ /usr/lib/python3/dist\\-packages\\ \\(1\\.21\\.5\\)\\ but\\ you\\ have\\ python\\ 3\\.11\\ and\\ numpy\\ is\\ not\\ importable",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "pip is resolving against a dist-packages directory for a different Python version. Usually caused by a mismatched pip (e.g. pip points to system Python while you run a pyenv Python), or PYTHONPATH leaking.",
  "root_cause_type": "generic",
  "root_cause_zh": "pip 正在针对不同 Python 版本的 dist-packages 目录进行解析。通常由 pip 与 Python 不匹配（例如 pip 指向系统 Python，而你运行的是 pyenv Python），或 PYTHONPATH 泄漏引起。",
  "versions": [
    {
      "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": "Still installs into the wrong interpreter's site-packages.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Makes things worse by mixing ABI-incompatible C extensions.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.98,
      "how": "python3.11 -m pip install numpy",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.95,
      "how": "which -a pip python && pip -V && python -V",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.98,
      "how": "python3.11 -m venv .venv && source .venv/bin/activate && pip install numpy",
      "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.87,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-07-04",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}