yum install zlib-devel bzip2-devel openssl-devel gcc python-devel
# tar xvzf Python-2.7.8.tgz# cd Python-2.7.8
# ./configure --prefix=/usr/local
# make --jobs=`grep processor/proc/cpuinfo | wc -l`
or make# make install
## 将python头文件拷贝到标准目录,以避免编译ansible时,找不到所需的头文件
# cd /usr/local/include/python2.7
# cp -a ./* /usr/local/include/
## 备份旧版本的python,并符号链接新版本的python
# cd /usr/bin
# mv python python2.6
# ln -s /usr/local/bin/python
## 修改yum脚本,使其指向旧版本的python,已避免其无法运行
# vim /usr/bin/yum
#!/usr/bin/python --> #!/usr/bin/python2.6
setuptools-7.0.tar.gz
pip-10.0.1.tar.gzpip install paramiko PyYAML Jinja2 httplib2 six
pip install pywinrm
安装完python 3.6.5
会自动安装pip-9.0.3,setuptools-39.0.1cd /usr/binln -s /usr/local/bin/python3
python3 -m pip install --upgrade pip