例如想要升级nibabel时

使用命令:sudo pip install --upgrade nibabel

报错:

Cannot uninstall ‘nibabel’. 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.

问题解析:

旧版本依赖多,不能清晰的删除,此时应该忽略旧版本升级,即如下

加上  --ignore-installed  

解决办法:sudo pip install nibabel --ignore-installed nibabel