python
system_error
ai_generated
true
ERROR: Cannot uninstall 'pkg'. 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
80%Fix Rate
86%Confidence
0Evidence
2024-09-02First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.5 | active | — | — | — |
| 3.6 | active | — | — | — |
| 3.7 | active | — | — | — |
Root Cause
The package was installed with distutils (or old setup.py install), and pip cannot track its files for clean removal.
generic中文
该包是使用 distutils(或旧的 setup.py install)安装的,pip 无法跟踪其文件以进行干净卸载。
Workarounds
-
80% success
pip install --ignore-installed pkg
-
70% success
rm -rf /path/to/site-packages/pkg* /path/to/site-packages/pkg-*.egg-info
Dead Ends
Common approaches that don't work:
-
90% fail
Pip doesn't have a --force uninstall; it will still fail.
-
40% fail
Risky and may leave residual files.