{
  "id": "pip/pep-660-editable-install-fails-no-build-backend",
  "signature": "ERROR: Project has a 'pyproject.toml' and its build backend is missing the 'build_editable' hook. Cannot build editable. The build backend does not support the 'build_editable' hook.",
  "signature_zh": "错误：项目有 'pyproject.toml'，但其构建后端缺少 'build_editable' 钩子。无法构建可编辑版本。构建后端不支持 'build_editable' 钩子。",
  "regex": "ERROR: Project has a 'pyproject\\.toml' and its build backend is missing the 'build_editable' hook\\. Cannot build editable\\.",
  "domain": "pip",
  "category": "build_error",
  "subcategory": null,
  "root_cause": "The build backend specified in pyproject.toml (e.g., an older version of setuptools or a custom backend) does not implement the PEP 660 `build_editable` hook, which is required for editable installs using `pip install -e`.",
  "root_cause_type": "generic",
  "root_cause_zh": "pyproject.toml 中指定的构建后端（例如较旧版本的 setuptools 或自定义后端）未实现 PEP 660 的 `build_editable` 钩子，而该钩子是使用 `pip install -e` 进行可编辑安装所必需的。",
  "versions": [
    {
      "version": "pip 21.3",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "pip 23.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "pip 23.2.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The `--no-build-isolation` flag does not add the missing `build_editable` hook; it only prevents pip from creating a temporary build environment. The backend still lacks the hook.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This config setting is for setuptools specifically and only works if the backend already supports editable installs; it does not add the missing hook.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Upgrade the build backend to a version that supports PEP 660. For setuptools: `pip install --upgrade setuptools>=64.0.0`. For flit: `pip install --upgrade flit_core>=3.8.0`. Then retry `pip install -e .`.",
      "success_rate": 0.85,
      "how": "Upgrade the build backend to a version that supports PEP 660. For setuptools: `pip install --upgrade setuptools>=64.0.0`. For flit: `pip install --upgrade flit_core>=3.8.0`. Then retry `pip install -e .`.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Switch to a non-editable install temporarily: `pip install .` instead of `pip install -e .`. This bypasses the `build_editable` hook requirement.",
      "success_rate": 0.95,
      "how": "Switch to a non-editable install temporarily: `pip install .` instead of `pip install -e .`. This bypasses the `build_editable` hook requirement.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "升级构建后端到支持 PEP 660 的版本。对于 setuptools：`pip install --upgrade setuptools>=64.0.0`。对于 flit：`pip install --upgrade flit_core>=3.8.0`。然后重试 `pip install -e .`。",
    "临时切换到非可编辑安装：使用 `pip install .` 代替 `pip install -e .`。这将绕过 `build_editable` 钩子的要求。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://peps.python.org/pep-0660/",
  "official_doc_section": null,
  "error_code": "ERROR",
  "verification_tier": "ai_generated",
  "confidence": 0.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2023-06-12",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}