python config_error ai_generated true

错误:[Errno 2] 没有这样的文件或目录:'setup.py'

error: [Errno 2] No such file or directory: 'setup.py'

ID: python/pip-egg-info-build-failure

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

版本兼容性

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

根因分析

在错误的目录下运行构建/安装,或项目仅使用 pyproject.toml 布局。

English

Running build/install from the wrong directory or a project using pyproject.toml-only layout.

generic

解决方案

  1. 95% 成功率
    cd /path/to/project
    python -m pip install .
  2. 90% 成功率
    python -m build --sdist --wheel

无效尝试

常见但无效的做法:

  1. 75% 失败

    Breaks PEP 517 builds and confuses tooling.

  2. 85% 失败

    Still wrong directory; file remains missing.