Cannot uninstall 'html5lib'. It is a distutils installed project and thus we cannot accurately....

转自:https://blog.csdn.net/qq_20373723/article/details/80323344

        如标题,使用python3.6根据网页博客编写自动下载图片脚本时遇到的相似问题,需要升级第三方库,但是无法卸载,报错类似如下(软件包可能不同,对于相似问题可尝试使用同样方法处理)

Cannot uninstall 'html5lib'. 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.

问题解决:请找到python下面的路径


然后再找到这个文件把它删除就可以了



类似的,以后这种问题的解决方式都可以这样入手。

可能的原因,可能之前的第三方库是通过离线文件方式安装的, 删除相应的egg-info后可以尝试解决。


万能的stack overflow也给出了解决拌饭:

参考:https://stackoverflow.com/questions/34857242/os-x-uninstall-a-distutils-installed-project

I'm on El Capitan and I want to install numpy with pip. However I get the following error:

Detected a distutils installed project ('numpy') which we cannot uninstall. The metadata provided by distutils does not
 contain a list of files which have been installed, so pip does not know which files to uninstall.
The existing numpy version seems to be 1.10.4 and the one I try to install is 1.9.2, but I need it. Is there a way to uninstall this version with distutils? Or at least any way to tell pip that there is numpy installed?

Answers

Since there is no metadata about the installed files, I found the easiest way to be removing the files manually. Simply retrieve
 the directory of the module (I referred to this: Retrieving python module path), and delete the folder, as well as the accomp
anying .egg-info file. Then install your desired numpy version without the --update flag.

评论 11
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值