安装依赖:

yum install gcc zlib-devel openssl-devel readline-devel -y

安装python

wget https://www.python.org/ftp/python/3.6.6/Python-3.6.6.tgz
tar xvf Python-3.6.6.tgz
cd Python-3.6.6/
./configure --prefix=/usr/local/python/
 make && make install
/usr/local/python/bin/python3 --version
ln -s /usr/local/python/bin/python3 /usr/local/bin/
python3 --version

升级pip

/usr/local/python/bin/pip3 install --upgrade pip

安装ansible

/usr/local/python/bin/pip3 install ansible==2.9.5 -i  https://pypi.tuna.tsinghua.edu.cn/simple
/usr/local/python/bin/ansible --version
ln -s /usr/local/python/bin/ansible /usr/bin/
ansible --version
Logo

CSDN联合极客时间,共同打造面向开发者的精品内容学习社区,助力成长!

更多推荐