PIP安装提示ERROR: Cannot uninstall ‘setuptools’.

正在做一些数据迁移, 结果某个脚本迁移过来过后, 缺少某个库, 果断pip install一下, 好家伙…直接提示ERROR: Cannot uninstall 'setuptools'. 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.

解决方案

直接sudo find / -name setuptools -type d

/usr/share/pyshared/setuptools
/usr/lib/python2.7/dist-packages/setuptools
/usr/lib/python2.6/dist-packages/setuptools

/usr/lib/pythonx.x下的文件夹都删除或者重命名

然后sudo find / -name setuptools.egg-info

/usr/share/pyshared/setuptools.egg-info
/usr/lib/python2.7/dist-packages/setuptools.egg-info
/usr/lib/python2.6/dist-packages/setuptools.egg-info

/usr/lib/pythonx.x下的文件都删除或者重命名

再次安装, ok

发表评论

电子邮件地址不会被公开。