python install_error ai_generated true

错误:file:///path/to/project 似乎不是 Python 项目:既未找到 'setup.py' 也未找到 'pyproject.toml'。

ERROR: file:///path/to/project does not appear to be a Python project: neither 'setup.py' nor 'pyproject.toml' found.

ID: python/pip-setup-py-not-found

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

版本兼容性

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

根因分析

pip 被指向一个缺少构建元数据文件的目录(或 VCS URL),无法识别为 Python 包。

English

pip was pointed at a directory (or VCS URL) that lacks the build metadata files it needs to identify a Python package.

generic

解决方案

  1. 95% 成功率
    Point pip at the actual package directory that contains setup.py or pyproject.toml, or install from the parent with `pip install ./project`.
  2. 90% 成功率
    If the project uses only setup.cfg, add a minimal pyproject.toml: `[build-system]\nrequires=['setuptools>=61']\nbuild-backend='setuptools.build_meta'`.

无效尝试

常见但无效的做法:

  1. 90% 失败

    Skipping deps does not change the metadata discovery step; the same error is raised.

  2. 95% 失败

    The error is about the target directory, not the pip version.