在CentOS7中,如果python版本为3.x,在安装docker-compose时会报错:
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
这是因为安装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
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)