{
  "id": "pip/editable-install-no-setup-py",
  "signature": "ERROR: File 'setup.py' not found for editable install of '<package>'. A setup.py or pyproject.toml is required.",
  "signature_zh": "错误：找不到 'setup.py' 文件用于可编辑安装 '<package>'。需要 setup.py 或 pyproject.toml。",
  "regex": "ERROR: File 'setup\\.py' not found for editable install of '.*'\\. A setup\\.py or pyproject\\.toml is required\\.",
  "domain": "pip",
  "category": "install_error",
  "subcategory": null,
  "root_cause": "The package being installed in editable mode (pip install -e .) lacks a setup.py, and the pyproject.toml does not define a valid build backend that supports editable installs (e.g., setuptools or hatchling with the build_editable hook).",
  "root_cause_type": "generic",
  "root_cause_zh": "以可编辑模式安装的包（pip install -e .）缺少 setup.py，并且 pyproject.toml 没有定义支持可编辑安装的有效构建后端（例如具有 build_editable 钩子的 setuptools 或 hatchling）。",
  "versions": [
    {
      "version": "pip 21.3+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Python 3.7-3.12",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Without proper package discovery configuration, the editable install will fail or install nothing.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This does not resolve the missing setup.py; it only disables build isolation.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Older pip versions may work but are insecure and lack modern features; not a sustainable fix.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Add a pyproject.toml with a build backend that supports editable installs, e.g., using setuptools:\n[build-system]\nrequires = [\"setuptools>=64\"]\nbuild-backend = \"setuptools.build_meta\"\nThen run pip install -e . again.",
      "success_rate": 0.9,
      "how": "Add a pyproject.toml with a build backend that supports editable installs, e.g., using setuptools:\n[build-system]\nrequires = [\"setuptools>=64\"]\nbuild-backend = \"setuptools.build_meta\"\nThen run pip install -e . again.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If the project uses a modern backend like hatchling, ensure pyproject.toml includes:\n[build-system]\nrequires = [\"hatchling\"]\nbuild-backend = \"hatchling.build\"\n[project]\nname = \"<package>\"\nversion = \"0.1.0\"\nThen install with pip install -e .",
      "success_rate": 0.85,
      "how": "If the project uses a modern backend like hatchling, ensure pyproject.toml includes:\n[build-system]\nrequires = [\"hatchling\"]\nbuild-backend = \"hatchling.build\"\n[project]\nname = \"<package>\"\nversion = \"0.1.0\"\nThen install with pip install -e .",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a symlink manually instead of editable install: ln -s /path/to/package /path/to/site-packages/<package> (Linux/macOS) or mklink /D (Windows). This bypasses pip's editable install mechanism.",
      "success_rate": 0.7,
      "how": "Use a symlink manually instead of editable install: ln -s /path/to/package /path/to/site-packages/<package> (Linux/macOS) or mklink /D (Windows). This bypasses pip's editable install mechanism.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Add a pyproject.toml with a build backend that supports editable installs, e.g., using setuptools:\n[build-system]\nrequires = [\"setuptools>=64\"]\nbuild-backend = \"setuptools.build_meta\"\nThen run pip install -e . again.",
    "If the project uses a modern backend like hatchling, ensure pyproject.toml includes:\n[build-system]\nrequires = [\"hatchling\"]\nbuild-backend = \"hatchling.build\"\n[project]\nname = \"<package>\"\nversion = \"0.1.0\"\nThen install with pip install -e .",
    "Use a symlink manually instead of editable install: ln -s /path/to/package /path/to/site-packages/<package> (Linux/macOS) or mklink /D (Windows). This bypasses pip's editable install mechanism."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2023-09-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}