python install_error ai_generated partial

错误:无法卸载 'package'。它是 distutils 安装的项目,因此我们无法准确确定哪些文件属于它,这会导致仅部分卸载。

ERROR: Cannot uninstall 'package'. 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-uninstall-script-not-found

其他格式: JSON · Markdown 中文 · English
80%修复率
87%置信度
0证据数
2025-12-01首次发现

版本兼容性

版本状态引入弃用备注
3.x active — — —

根因分析

该包通过 distutils 安装(如 apt、系统 Python 或旧的 setup.py install),没有 RECORD 文件,因此 pip 无法枚举其文件以安全删除。

English

The package was installed via distutils (e.g., apt, system Python, or an old setup.py install) without a RECORD file, so pip cannot enumerate its files for safe removal.

generic

解决方案

  1. 90% 成功率
    Remove via the distro package manager: sudo apt remove python3-package
  2. 75% 成功率
    List files and remove them: pip show -f package && rm -rf $(pip show -f package | awk '/Location:/{print $2}')/package*
  3. 92% 成功率
    Create a fresh venv and reinstall the correct version: python -m venv .venv && . .venv/bin/activate && pip install package

无效尝试

常见但无效的做法:

  1. 90% 失败

    -y skips the confirmation prompt but does not bypass the distutils detection.

  2. 70% 失败

    Force-reinstall may leave the old distutils files in place, causing version conflicts.

  3. 80% 失败

    Manual deletion misses .dist-info, .pth, and console scripts, leaving a broken environment.