# ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '.../egg-info/PKG-INFO'

- **ID:** `python/pip-egg-info-missing-metadata`
- **Domain:** python
- **Category:** install_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The package's setup.py or setup.cfg references egg-info metadata that was not generated, often due to a missing setup() call or incorrect build backend configuration.

## Version Compatibility

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

## Workarounds

1. **** (85% success)
   ```
   Ensure setup.py has a proper setup() call: `python setup.py egg_info` to pre-generate metadata, then pip install .
   ```
2. **** (90% success)
   ```
   Switch to pyproject.toml with setuptools.build_meta: `[build-system] requires = ["setuptools"] build-backend = "setuptools.build_meta"` and run pip install .
   ```
3. **** (75% success)
   ```
   Clean rebuild: `rm -rf *.egg-info build dist && pip install --no-cache-dir .`
   ```

## Dead Ends

- **** — pip will overwrite or ignore manually created files, and the underlying metadata generation process is still broken. (95% fail)
- **** — This bypasses isolated build environments but doesn't fix the fundamental setup.py issue; the error persists if setup.py is malformed. (70% fail)
- **** — If the build backend doesn't regenerate it properly due to configuration errors, deletion alone won't solve the problem. (60% fail)
