python install_error ai_generated partial

错误:metadata-generation-failed × 生成包元数据时遇到错误。 ╰─> 请参见上方输出。

error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output.

ID: python/pip-metadata-generation-failed-setup-py

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

版本兼容性

版本状态引入弃用备注
3.9 active
3.10 active
3.11 active

根因分析

包的 setup.py/pyproject.toml 在生成元数据时抛出异常,通常由于缺少构建依赖或不兼容的 setuptools。

English

The package's setup.py/pyproject.toml raises during metadata generation, often due to missing build deps or incompatible setuptools.

generic

解决方案

  1. 90% 成功率
    pip install -vvv foo
  2. 85% 成功率
    pip install -U pip setuptools wheel
    pip install foo

无效尝试

常见但无效的做法:

  1. 80% 失败

    Cache is not the root cause; metadata generation still fails.

  2. 70% 失败

    Pre-release may have the same broken metadata.