前提:CentOS 7 下安装Python环境,从而运行docker-compose
一般情况下,用yum的安装顺序如下:
1. yum -y install epel-release
2. yum -y install python-pip
3. pip install docker-compose
在执行第二步的时候报错,报错内容如下:
Requires: python(abi) = 2.6

因为CentOS7,有的默认安装版本是2.7。
这时候,可以采用wget来安装Python环境
1. wget https://bootstrap.pypa.io/get-pip.py
2. sudo python get-pip.py
3. pip -V 确认安装成功
这时候再执行pip install docker-compose,如果成功,万事大吉,如果不成功,可能会报如下错误:
Cannot uninstall 'requests'. 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 pip install --ignore-installed docker-compose
本文介绍在CentOS 7下安装Python环境以运行docker-compose的方法。先用yum安装,若执行第二步报错,可采用wget安装Python环境。安装docker-compose若报错,执行sudo pip install --ignore-installed docker-compose即可成功。
4234

被折叠的 条评论
为什么被折叠?



