python install_error ai_generated true

错误:文件 "/tmp/pip-build-env-xxxx/overlay/lib/python3.11/site-packages/setuptools/build_meta.py",第 435 行,在 get_requires_for_build_editable 中 raise NotImplementedError("此构建后端不支持可编辑安装")

ERROR: File "/tmp/pip-build-env-xxxx/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 435, in get_requires_for_build_editable raise NotImplementedError("editable installs are not supported by this backend")

ID: python/pip-editable-install-fails-pep660

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

版本兼容性

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

根因分析

`pip install -e .` 使用 PEP 660 可编辑 wheel,但项目的构建后端(或旧版 setuptools)未实现 `build_editable`。

English

`pip install -e .` uses PEP 660 editable wheels, but the project's build backend (or an old setuptools) does not implement `build_editable`.

generic

解决方案

  1. 90% 成功率
    Upgrade setuptools so PEP 660 is supported: `pip install --upgrade 'setuptools>=64'`, then `pip install -e .`.
  2. 75% 成功率
    Fall back to legacy editable: `pip install -e . --config-settings editable_mode=compat` (setuptools) or switch the backend to one that supports PEP 660.

无效尝试

常见但无效的做法:

  1. 80% 失败

    Still calls the backend's build_editable hook, which is unimplemented.

  2. 85% 失败

    PEP 517 is already the default; the hook is missing regardless.