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.

猜你喜欢

转载自blog.csdn.net/qiye005/article/details/80383467