python install_error ai_generated true

错误:此包需要 pip 版本 21.0 或更高,但你的版本是 20.0.2

ERROR: This package requires pip version 21.0 or higher, but you have 20.0.2

ID: python/pip-install-error-requires-pip-version

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

版本兼容性

版本状态引入弃用备注
3.7 active — — —
3.8 active — — —
3.9 active — — —
3.10 active — — —

根因分析

包使用 pyproject.toml,其 build-system 要求指定了最低 pip 版本,而安装的 pip 太旧,无法理解元数据格式。

English

The package uses a pyproject.toml with build-system requirements that specify a minimum pip version, and the installed pip is too old to understand the metadata format.

generic

解决方案

  1. 98% 成功率
    Upgrade pip: python -m pip install --upgrade pip.
  2. 90% 成功率
    If upgrade fails due to permissions, use --user: python -m pip install --user --upgrade pip.

无效尝试

常见但无效的做法:

  1. 85% 失败

    Old pip cannot parse the pyproject.toml correctly, leading to build failures.

  2. 75% 失败

    Requires downloading and modifying the package, and may still fail due to other incompatibilities.