ERROR: Cannot uninstall ‘xxx‘. It is a distutils installed project and thus we cannot accurately det

2023-05-16

ERROR: Cannot uninstall ‘TBB’. 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.解决办法

原因:

使用底层工具 distutils安装的自带package,缺失了文件列表信息,导致无法根据文件列表卸载旧版,无法替换旧版文件,无法干净地升级,所以python拒绝安装或者升级某个package。

现状:

遗留问题,深层bug,官方无法漂亮地解决

解决方案:

手动删除这个包,再用pip或者conda安装,新的版本就都会带有完整的文件列表信息了。

如何手动删除:

找到你的python包库,

查看方法: pip -V 回车(大写V)
为了查看无法卸载的包是在哪个conda环境中,因为可能有多个conda环境

进入库目录 xxx/site-packages/

找到要卸载的旧版包,比如旧版的llvmlite
llvmlite/
llvmlite-0.27.1_0.gf008359.dirty-py3.6.egg-info

把它们删除,或者重命名:

llvmlite-bak/
llvmlite-0.27.1_0.gf008359.dirty-py3.6.egg-info-bak

之后即可正常安装新版的llvmlite,或任何你删除干净的其他包。

使用conda自动卸载

conda进入无法卸载的包所在的环境

conda uninstall TBB (包名)

————————————————
版权声明:本文为CSDN博主「RockHell」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/u010469993/article/details/102623270

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

ERROR: Cannot uninstall ‘xxx‘. It is a distutils installed project and thus we cannot accurately det 的相关文章

随机推荐