# 错误：安装被用户中止。KeyboardInterrupt

- **ID:** `pip/installation-aborted-by-user`
- **领域:** pip
- **类别:** system_error
- **错误码:** `ERROR`
- **验证级别:** ai_generated
- **修复率:** 100%

## 根因

用户在 pip install 操作期间按下了 Ctrl+C（或发送了 SIGINT），导致 Python 引发 KeyboardInterrupt 异常，pip 将其处理为中止。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| pip 23.0 | active | — | — |
| pip 23.1 | active | — | — |
| pip 24.0 | active | — | — |

## 解决方案

1. ```
   只需重新运行 pip install 命令。示例：pip install package
   ```
2. ```
   如果安装时间过长且希望避免未来中止，请考虑使用超时或后台运行：timeout 300 pip install package
   ```
3. ```
   使用 pip 的 --no-cache-dir 标志避免在中止后重新下载：pip install --no-cache-dir package
   ```

## 无效尝试

- **** — The error is transient; simply re-running the command works. (10% 失败率)
- **** — The abort is due to user input, not permissions; sudo does not prevent Ctrl+C. (20% 失败率)
