# ERROR: Cannot uninstall 'numpy'. 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-distutils-installed`
- **Domain:** python
- **Category:** install_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The package was installed by the OS package manager (apt/yum) via distutils, so pip has no RECORD file to know which files to remove.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   Create a virtualenv so pip owns the packages:
  python -m venv .venv && source .venv/bin/activate
  pip install numpy
   ```
2. **** (80% success)
   ```
   Force pip to ignore the installed version:
  pip install --ignore-installed numpy
   ```
3. **** (75% success)
   ```
   Remove the OS package first:
  sudo apt-get remove python3-numpy
  pip install numpy
   ```

## Dead Ends

- **** — Upgrade still needs to uninstall the old version first; same error occurs. (85% fail)
- **** — Manually deleting files leaves stale metadata in the OS package database and can break system tools. (70% fail)
