{
  "id": "python/pip-install-from-git-missing-setuptools-scm",
  "signature": "ERROR: Command errored out with exit status 1: python setup.py egg_info ... LookupError: setuptools-scm was unable to detect version for /tmp/pip-req-build-xxxx.",
  "signature_zh": "错误：命令出错，退出状态为 1：python setup.py egg_info ... LookupError：setuptools-scm 无法为 /tmp/pip-req-build-xxxx 检测版本。",
  "regex": "ERROR:\\ Command\\ errored\\ out\\ with\\ exit\\ status\\ 1:\\ python\\ setup\\.py\\ egg_info\\ \\.\\.\\.\\ LookupError:\\ setuptools\\-scm\\ was\\ unable\\ to\\ detect\\ version\\ for\\ /tmp/pip\\-req\\-build\\-xxxx\\.",
  "domain": "python",
  "category": "install_error",
  "subcategory": null,
  "root_cause": "Installing a git checkout that uses setuptools_scm, but the .git directory is missing from the pip build sandbox, so no version tag can be resolved.",
  "root_cause_type": "generic",
  "root_cause_zh": "安装使用了 setuptools_scm 的 git 检出，但 pip 构建沙箱中缺少 .git 目录，因此无法解析版本标签。",
  "versions": [
    {
      "version": "3.8",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.9",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.11",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.12",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Still uses the same extracted source tree without .git; version detection continues to fail.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Produces a bogus 0.0.0 version that breaks dependency resolution and downstream pins.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Install from a built sdist/wheel instead: `python -m build && pip install dist/pkg-*.whl`.",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.88,
      "how": "If installing from a git URL, ensure pip can fetch tags: `pip install \"git+https://github.com/org/repo.git@v1.2.3\"` (explicit tag bypasses scm detection).",
      "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.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-09-12",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}