python
config_error
ai_generated
true
Requirement already satisfied: foo in /usr/lib/python3/dist-packages (1.0.0), but you have foo 2.0.0
ID: python/pip-requirement-already-satisfied-wrong-version
80%Fix Rate
84%Confidence
0Evidence
2024-07-22First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.x | active | — | — | — |
Root Cause
Multiple site-packages locations on sys.path; pip sees one installed copy while another shadows it.
generic中文
sys.path 上存在多个 site-packages 位置;pip 看到的是一个已安装副本,而另一个副本将其遮蔽。
Workarounds
-
95% success
python -m venv .venv source .venv/bin/activate pip install foo
-
75% success
python -c "import sys; print('\n'.join(sys.path))" python -m pip install --target=/custom/path foo
Dead Ends
Common approaches that don't work:
-
60% fail
Reinstalls into one location while the shadowing copy remains, so the wrong version still imports.
-
80% fail
Removing system packages can break OS tooling and is often not permitted.