{
  "id": "python/pip-build-isolation-missing-setuptools",
  "signature": "ModuleNotFoundError: No module named 'setuptools' during pip install -e . (pyproject.toml build backend)",
  "signature_zh": "在 pip install -e . 期间出现 ModuleNotFoundError：没有名为 'setuptools' 的模块（pyproject.toml 构建后端）",
  "regex": "ModuleNotFoundError:\\ No\\ module\\ named\\ 'setuptools'\\ during\\ pip\\ install\\ \\-e\\ \\.\\ \\(pyproject\\.toml\\ build\\ backend\\)",
  "domain": "python",
  "category": "module_error",
  "subcategory": null,
  "root_cause": "A pyproject.toml declares setuptools.build_meta as the backend, but the build isolation environment or the project's build-system.requires does not include setuptools.",
  "root_cause_type": "generic",
  "root_cause_zh": "pyproject.toml 声明 setuptools.build_meta 作为后端，但构建隔离环境或项目的 build-system.requires 未包含 setuptools。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Uses the current env, which may also lack setuptools or have an incompatible version; masks the real config bug.",
      "fail_rate": 0.65,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Installs in the outer env but build isolation still creates a fresh env without it.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Declare the build requirement in pyproject.toml:\n[build-system]\nrequires = [\"setuptools>=61\", \"wheel\"]\nbuild-backend = \"setuptools.build_meta\"",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Install build deps explicitly then build:\npip install setuptools wheel build\npython -m build",
      "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.87,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-08-22",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}