{
  "id": "python/setuptools-no-setup-py",
  "signature": "FileNotFoundError: [Errno 2] No such file or directory: 'setup.py'\nERROR: Failed to build 'foo' when getting requirements to build wheel",
  "signature_zh": "FileNotFoundError：[Errno 2] 没有那个文件或目录：'setup.py'\n错误：在获取构建 wheel 所需依赖时构建 'foo' 失败",
  "regex": "FileNotFoundError:\\ \\[Errno\\ 2\\]\\ No\\ such\\ file\\ or\\ directory:\\ 'setup\\.py'\\\nERROR:\\ Failed\\ to\\ build\\ 'foo'\\ when\\ getting\\ requirements\\ to\\ build\\ wheel",
  "domain": "python",
  "category": "install_error",
  "subcategory": null,
  "root_cause": "The project has no setup.py (pyproject.toml-only) but a tool or pip invocation assumes the legacy setup.py entry point, or the working directory is wrong.",
  "root_cause_type": "generic",
  "root_cause_zh": "项目没有 setup.py（仅 pyproject.toml），但某个工具或 pip 调用假定使用旧的 setup.py 入口，或工作目录错误。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "An empty setup.py makes the build fail later with 'no commands supplied' or metadata errors.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Still expects a build backend; if pyproject.toml is missing, there is nothing to build.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.92,
      "how": "Add a minimal pyproject.toml with a build backend:\n[build-system]\nrequires = [\"setuptools>=61\"]\nbuild-backend = \"setuptools.build_meta\"\n\n[project]\nname = \"foo\"\nversion = \"1.0.0\"",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "Confirm you are in the project root:\nls pyproject.toml setup.py setup.cfg\npip install .",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-03-19",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}