{
  "id": "python/pip-install-permission-denied",
  "signature": "ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/lib/python3.10/site-packages/package'",
  "signature_zh": "错误：由于环境错误无法安装包：[Errno 13] 权限被拒绝：'/usr/local/lib/python3.10/site-packages/package'",
  "regex": "ERROR:\\ Could\\ not\\ install\\ packages\\ due\\ to\\ an\\ EnvironmentError:\\ \\[Errno\\ 13\\]\\ Permission\\ denied:\\ '/usr/local/lib/python3\\.10/site\\-packages/package'",
  "domain": "python",
  "category": "system_error",
  "subcategory": null,
  "root_cause": "The user lacks write permissions to the system site-packages directory.",
  "root_cause_type": "generic",
  "root_cause_zh": "用户对系统 site-packages 目录没有写权限。",
  "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"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Using sudo pip install",
      "why_fails": "Risky and may break system Python packages.",
      "fail_rate": 0.4,
      "condition": "",
      "sources": []
    },
    {
      "action": "Changing directory permissions",
      "why_fails": "May cause system instability.",
      "fail_rate": 0.3,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Install with --user flag",
      "success_rate": 0.9,
      "how": "pip install --user package_name",
      "condition": "",
      "sources": []
    },
    {
      "action": "Create a virtual environment",
      "success_rate": 0.95,
      "how": "python -m venv myenv && source myenv/bin/activate && pip install package_name",
      "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.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-01-10",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}