python
install_error
ai_generated
true
错误:无法卸载 'package_name'。它是 distutils 安装的项目,因此我们无法准确确定哪些文件属于它,这会导致仅部分卸载。
ERROR: Cannot uninstall 'package_name'. 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-required-by
80%修复率
83%置信度
0证据数
2025-09-10首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 3.8 | active | — | — | — |
| 3.9 | active | — | — | — |
根因分析
包是通过 distutils 安装的,pip 无法安全卸载。
English
The package was installed via distutils, and pip cannot safely uninstall it.
解决方案
-
80% 成功率 Reinstall the package with pip first
pip install --force-reinstall package_name && pip uninstall package_name
-
90% 成功率 Use a virtual environment
python -m venv newenv && source newenv/bin/activate && pip install package_name
无效尝试
常见但无效的做法:
-
Using --force to uninstall
50% 失败
May leave broken files.
-
Manually deleting files
70% 失败
Risky and incomplete.