# ERROR: Cannot uninstall 'package_name'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

- **ID:** `python/pip-cannot-uninstall-required-by`
- **Domain:** python
- **Category:** install_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The package was installed via distutils, and pip cannot safely uninstall it.

## Version Compatibility

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

## Workarounds

1. **Reinstall the package with pip first** (80% success)
   ```
   pip install --force-reinstall package_name && pip uninstall package_name
   ```
2. **Use a virtual environment** (90% success)
   ```
   python -m venv newenv && source newenv/bin/activate && pip install package_name
   ```

## Dead Ends

- **Using --force to uninstall** — May leave broken files. (50% fail)
- **Manually deleting files** — Risky and incomplete. (70% fail)
