{
  "id": "python/pip-install-location-error",
  "signature": "ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv.",
  "signature_zh": "错误：无法执行'--user'安装。用户site-packages在此虚拟环境中不可见。",
  "regex": "ERROR:\\ Can\\ not\\ perform\\ a\\ '\\-\\-user'\\ install\\.\\ User\\ site\\-packages\\ are\\ not\\ visible\\ in\\ this\\ virtualenv\\.",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "The user is trying to use --user flag inside a virtual environment, which is not allowed because user site-packages are disabled.",
  "root_cause_type": "generic",
  "root_cause_zh": "用户尝试在虚拟环境中使用--user标志，这是不允许的，因为用户site-packages被禁用。",
  "versions": [
    {
      "version": "3.11",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Installs into virtualenv, which may be fine but not user-level.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Loses isolation.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Exposes system packages, may conflict.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "pip install package",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.8,
      "how": "python -m venv --system-site-packages venv && source venv/bin/activate && pip install --user package",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "Deactivate venv and run pip install --user package",
      "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": "2025-09-20",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}