pip安装
#安装依赖
yum -y install epel-release
#安装PIP
yum -y install python-pip
#升级PIP
pip install --upgrade pip
#查看pip版本
pip --version
#安装docker-compose
pip install docker-compose
#卸载
pip uninstall docker-compose
注意1:在pip安装时遇到“ERROR: Package 'more-itertools' requires a different Python: 2.7.5 not in '>=3.5'”并不一定要升级python,也可以使用“pip install more-itertools==5.0.0”解决该问题。
注意2:在pip安装时遇到“ERROR: Cannot uninstall '模块名'. It is a distutils installed...”时,需要使用“pip install --ignore-installed [报错的模块名]”安装,之后再重新pip安装。
安装报错可执行下列命令
pip install --upgrade pip
pip install --upgrade setuptools
docker update --restart=no my-container