安裝必須的包python
yum install zlib-devel bzip2-devel pcre-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel
下載安裝2.7.x版本Python sql
1 wget http://python.org/ftp/python/2.7.6/Python-2.7.6.tar.bz2 2 tar xvf Python-2.7.6.tar.bz2 3 cd Python-2.7.6 4 ./configure --prefix=/usr/local 5 make && make altinstall
移除2.6版本的連接spa
mv /usr/bin/python /usr/bin/python2.6.bak
創建新版本連接code
ln -s /usr/local/python2.7/bin/python2.7 /usr/bin/python
安裝easy_installsqlite
wget https://pypi.python.org/packages/source/d/distribute/distribute-0.6.49.tar.gz tar xf distribute-0.6.49.tar.gz cd distribute-0.6.49 python setup.py install ln -s /usr/local/python2.7/bin/easy_install /usr/bin easy_install --version
安裝pipblog
easy_install pip ln -s /usr/local/python2.7/bin/pip /usr/bin pip --version
解決Yum使用舊版2.6問題ip
sed -i '1c #!/usr/bin/python2.6' /usr/bin/yum