# error: externally-managed-environment

- **ID:** `python/pip-subprocess-error-externally-managed-environment`
- **Domain:** python
- **Category:** install_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

PEP 668 prevents pip from installing packages into the system Python environment to avoid conflicts with the OS package manager. This occurs on Debian/Ubuntu and similar distributions.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **** (98% success)
   ```
   python3 -m venv myenv && source myenv/bin/activate && pip install package_name
   ```
2. **** (70% success)
   ```
   pip install --break-system-packages package_name
   ```
3. **** (90% success)
   ```
   pipx install package_name
   ```

## Dead Ends

- **** — Root privileges do not bypass the externally-managed-environment check; the error persists. (90% fail)
- **** — Reinstalling pip does not change the environment management policy. (80% fail)
- **** — This environment variable is unrelated to PEP 668 enforcement. (95% fail)
