# 警告：为下载或安装选择的候选版本是被撤回的版本：'foo' 候选（版本 1.2.3）。撤回原因：构建损坏。

- **ID:** `python/pip-yanked-version-installed`
- **领域:** python
- **类别:** install_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

维护者在 PyPI 上撤回了某个发布；如果它是唯一满足约束的版本，pip 仍会安装，但会发出警告。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.9 | active | — | — |
| 3.10 | active | — | — |
| 3.11 | active | — | — |
| 3.12 | active | — | — |

## 解决方案

1. **** (90% 成功率)
   ```
   Pin to a non-yanked version:
  pip install 'foo==1.2.2'
Or allow any non-yanked:
  pip install 'foo!=1.2.3'
   ```
2. **** (90% 成功率)
   ```
   Check available versions:
  pip index versions foo
Then choose the latest non-yanked release.
   ```

## 无效尝试

- **** — Upgrade only moves to a newer version if one is available; if the yanked release is the only match, the warning persists. (60% 失败率)
- **** — That flag controls script location warnings, not yanked-version warnings. (95% 失败率)
