python install_error ai_generated partial

警告:跳过 mypkg,因为它未安装。 错误:无法卸载 'mypkg'。它是一个 distutils 安装的项目,因此我们无法准确确定哪些文件属于它,这会导致只能部分卸载。

WARNING: Skipping mypkg as it is not installed. ERROR: Cannot uninstall 'mypkg'. 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-no-files-were-found

其他格式: JSON · Markdown 中文 · English
80%修复率
83%置信度
0证据数
2024-04-23首次发现

版本兼容性

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

根因分析

该包由 distutils 安装(例如通过 setup.py install 或操作系统包),没有 RECORD 文件,因此 pip 无法枚举要删除的文件。

English

The package was installed by distutils (e.g., via setup.py install or an OS package) without a RECORD file, so pip cannot enumerate the files to remove.

generic

解决方案

  1. 85% 成功率
    python -c "import mypkg, os; print(os.path.dirname(mypkg.__file__))"
    rm -rf /path/to/mypkg /path/to/mypkg-*.egg-info
  2. 90% 成功率
    sudo apt remove python3-mypkg

无效尝试

常见但无效的做法:

  1. 90% 失败

    The -y flag suppresses the prompt but the distutils detection still aborts.

  2. 60% 失败

    Force reinstall may leave the distutils-installed files behind, so uninstall still cannot find them.

  3. 85% 失败

    --break-system-packages is for installs, not for distutils uninstall detection.