python install_error ai_generated true

错误:无法复制 'PKG-INFO':不存在或不是常规文件

error: can't copy 'PKG-INFO': doesn't exist or not a regular file

ID: python/pip-setup-py-egg-info-failed

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

版本兼容性

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

根因分析

源代码分发包缺少 PKG-INFO 文件,通常是由于 sdist 创建不完整或下载损坏导致。setuptools 在安装过程中需要此文件。

English

The source distribution is missing the PKG-INFO file, often due to incomplete sdist creation or a corrupted download. setuptools expects this file during installation.

generic

解决方案

  1. 80% 成功率
    Download the package from PyPI manually and inspect the tarball; if corrupted, re-download. Alternatively, install from a wheel if available: pip install package.whl.
  2. 85% 成功率
    Install directly from the source repository: pip install git+https://github.com/user/repo.git.

无效尝试

常见但无效的做法:

  1. 85% 失败

    If PKG-INFO is missing from the sdist, egg_info cannot generate it without the proper source files.

  2. 90% 失败

    The issue is with the package source, not setuptools itself.