python install_error ai_generated true

警告:选择用于下载或安装的候选版本已被撤回:'mypkg' 候选(版本 2.0.0,位于 https://.../mypkg-2.0.0-py3-none-any.whl(来自 https://pypi.org/simple/mypkg/)) 被撤回原因:<未提供>

WARNING: The candidate selected for download or install is a yanked version: 'mypkg' candidate (version 2.0.0 at https://.../mypkg-2.0.0-py3-none-any.whl (from https://pypi.org/simple/mypkg/)) Reason for being yanked: <none given>

ID: python/pip-yanked-version-selected

其他格式: JSON · Markdown 中文 · English
80%修复率
85%置信度
0证据数
2025-01-14首次发现

版本兼容性

版本状态引入弃用备注
3.x active — — —

根因分析

requirements.txt 中固定的版本已在 PyPI 上被撤回,但由于固定版本明确请求该确切版本,pip 仍然解析到它。

English

A pinned version in requirements.txt was yanked on PyPI, but pip still resolves it because the pin explicitly requests that exact version.

generic

解决方案

  1. 98% 成功率
    Edit requirements.txt to mypkg==2.0.1 (or >=2.0.1,<3) and re-run pip install -r requirements.txt.
  2. 90% 成功率
    Run pip-audit or pip index versions mypkg to list available versions and identify yanked ones.

无效尝试

常见但无效的做法:

  1. 90% 失败

    Cache is not the reason the yanked version was selected.

  2. 88% 失败

    Still resolves to the same yanked version.

  3. 80% 失败

    Older pip silently installs yanked versions, hiding the problem.