# pkg_resources.ContextualVersionConflict: (urllib3 2.0.0 (/usr/lib/python3/dist-packages), Requirement.parse('urllib3<1.27,>=1.21.1'), {'botocore'})

- **ID:** `python/setuptools-pkg-resources-contextual-version`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

pkg_resources detects that an already-installed version of a package violates another installed package's declared requirement.

## 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)
   ```
   pip install 'urllib3>=1.21.1,<1.27'
   ```
2. **** (70% success)
   ```
   pip install --upgrade botocore boto3
   ```
3. **** (90% success)
   ```
   python -m venv .venv && . .venv/bin/activate && pip install -r requirements.txt
   ```

## Dead Ends

- **** — Hides the conflict but the underlying API incompatibility remains and breaks at runtime. (85% fail)
- **** — Newer botocore may still pin urllib3<2, and other packages may also require the old version. (60% fail)
- **** — pkg_resources ships with setuptools and is required by many packages; removal breaks the environment. (95% fail)
