Upgrade comes with 2.6.6 Version to 2.7.12
1. Download the decompression PYTHON-2.7.12.TAR.XZ
xz -d Python-2.7.12.tar.xztar -xvf Python-2.7.12.tar
2. Install the following dependencies, if necessary, or resolve dependencies based on compilation
yum -y updateyum‘development tools‘yum -y install zlib-devel bzip2-devel openssl-devel xz-libs wget ncurses-devel
3. Install Python
cd Python-2.7.12./configure --prefix=/usr/local/pythonmakemake#altinstall可以避免安装时创建任何软连接
4. Establish a connection
mv /usr/bin/python{,.old}ln -s /usr/local/python/bin/python2.7 /usr/bin/python
5. Install Pip and Setuptools
Download get-pip.py, download link in pypi setuptools installation documentation
python get-pip.pymv /usr/bin/pip{,.old}ln -s /usr/local/python/bin/pip /usr/bin/pipmv /usr/bin/easy_install{,.old}ln -s /usr/local/python/bin/easy_install /usr/bin/easy_install
6. Fix Yum, modify/usr/bin/yum
#!/usr/bin/python #修改前#!/usr/bin/python.old #修改后
Eof
CentOS6.5 Binary Package Upgrade Python