# ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '.../METADATA'

- **ID:** `python/pip-metadata-file-not-found`
- **Domain:** python
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A previously partially installed or corrupted package directory lacks the required METADATA file, causing pip to fail during metadata validation.

## Version Compatibility

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

## Workarounds

1. **Remove the corrupted package directory manually** (95% success)
   ```
   Find the site-packages directory (e.g., `python -m site --user-site`), then delete the package folder (e.g., `rm -rf <package_name>-*`). Then reinstall.
   ```
2. **Use pip's `--no-cache-dir` and reinstall** (85% success)
   ```
   `pip install --no-cache-dir --force-reinstall <package_name>`
   ```

## Dead Ends

- **Reinstalling the package with `--force-reinstall`** — If the existing broken directory is not cleaned, pip may still encounter the same missing file. (50% fail)
- **Manually creating an empty METADATA file** — The METADATA file must contain valid package metadata; an empty file will cause parsing errors. (90% fail)
