安装docker-compse时报错 ERROR: Cannot uninstall 'PyYAML'. It is a distutils

 

安装docker-compse时报错:

ERROR: 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

看了很多博文都解决不了问题,后来在github上找到解决办法 原来这个报错是因为安装docker-compose需要更新PyYAML,PyYAML是distutils的,而pip10以上的版本无法卸载distutils的软件(更新需要先卸载旧版本),所以可以把pip的版本先临时降到10以下,待安装完成后再恢复到最新版本

把pip版本降低
pip install --upgrade --force-reinstall pip==9.0.3
尝试重新安装软件包:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple docker-compose==1.24.1
最后,恢复最新版本的pip:
pip install --upgrade pip

 

还是要学好英文啊,不然看半天博文都不及github的一个issue

 
posted @ 2021-05-13 14:26  爱吃猫的鱼儿  阅读(1419)  评论(0)    收藏  举报