pip安装报错:Cannot uninstall ‘PyYAML’.

提问者:帅平 问题分类:运维
pip安装的时候报错:Cannot uninstall ‘PyYAML’.. 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. 这个看起来的意思是本服务器上已经存在了PyYAML,怎么卸载掉?
1 个回答
待我幼稚完
待我幼稚完
这里的卸载不能使用pip进行卸载,可以直接找到对应的目录文件,然后把他删除掉即可。操作步骤如下:
1、使用如下的命令查找PyYAML
find / -name "*PyYAML*"

2、查找到的结果实例如下:

3、然后使用下面的命令直接删除掉即可,示例如下:
rm -rf /usr/local/qcloud/python/lib/python3.7/site-packages/PyYAML-6.0.dist-info
rm -rf /usr/lib64/python3.6/site-packages/PyYAML-3.12-py3.6.egg-info
发布于:2年前 (2023-02-02) IP属地:四川省
我来回答