# 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.

- **ID:** `python/pip-install-from-git-missing-setuptools-scm`
- **Domain:** python
- **Category:** install_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## 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.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.8 | active | — | — |
| 3.9 | active | — | — |
| 3.10 | active | — | — |
| 3.11 | active | — | — |
| 3.12 | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   Install from a built sdist/wheel instead: `python -m build && pip install dist/pkg-*.whl`.
   ```
2. **** (88% success)
   ```
   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).
   ```

## Dead Ends

- **** — Still uses the same extracted source tree without .git; version detection continues to fail. (80% fail)
- **** — Produces a bogus 0.0.0 version that breaks dependency resolution and downstream pins. (70% fail)
