# 错误：由于 OSError 无法安装包：[Errno 13] 权限被拒绝：'/usr/local/lib/python3.10/site-packages'

- **ID:** `python/pip-install-permission-denied-site-packages`
- **领域:** python
- **类别:** system_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

用户对系统范围的 site-packages 目录没有写权限。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.x | active | — | — |

## 解决方案

1. **** (98% 成功率)
   ```
   python -m venv myenv; source myenv/bin/activate; pip install package
   ```
2. **** (85% 成功率)
   ```
   pip install --user package
   ```

## 无效尝试

- **** — May cause permission issues for other users and is not recommended in virtualenvs. (60% 失败率)
- **** — Installs to user site-packages, which may not be in PATH or may conflict with system packages. (40% 失败率)
