python install_error ai_generated partial

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

Also available as: JSON · Markdown · 中文
80%Fix Rate
87%Confidence
0Evidence
2025-12-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.x active — — —

Root Cause

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

中文

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

Workarounds

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

Dead Ends

Common approaches that don't work:

  1. 90% fail

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

  2. 70% fail

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

  3. 80% fail

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