# pkg_resources.VersionConflict: (foo 1.0 (/usr/lib/python3/dist-packages), Requirement.parse('foo>=2.0'))

- **ID:** `python/setuptools-could-not-find-version-satisfying`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

At import time, pkg_resources checks installed distributions and finds a version that does not satisfy a declared requirement, often because two packages were installed into different site-packages directories.

## Version Compatibility

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

## Workarounds

1. **** (90% success)
   ```
   Check which foo is found:
  python -c "import foo; print(foo.__file__)"
  pip show foo
Then uninstall the old one:
  pip uninstall foo
  pip install 'foo>=2.0'
   ```
2. **** (90% success)
   ```
   Use a virtualenv with --system-site-packages disabled so the system dist-packages does not shadow your venv:
  python -m venv .venv  # do NOT pass --system-site-packages
  source .venv/bin/activate
  pip install foo
   ```

## Dead Ends

- **** — If the old foo is in the system dist-packages and pip installs to user site-packages, pkg_resources may still find the old one first. (70% fail)
- **** — Hides the version mismatch; the package may call APIs that do not exist in the old version and crash later. (75% fail)
