#升级前必须先安装其它依赖
yum install readline-devel sqlite-devel bzip2-devel openssl-devel gdbm-devel libdbi-devel ncurses-libs zlib-devel -y
#下载python安装包wget https://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgztar -zxvf Python-2.7.6.tgzcd Python-2.7.6./configure --PRefix=/usr/local/python2.7make && make installmake cleanmake distclean
#移除旧的Python链接mv /usr/bin/python /usr/bin/python2.6.6
ln -s /usr/local/python2.7/bin/python2.7 /usr/bin/python#安装setuptoolscd ..wget http://pypi.douban.com/packages/source/s/setuptools/setuptools-12.0.5.tar.gztar zxvf setuptools-12.0.5.tar.gzcd setuptools-12.0.5python setup.py buildpython setup.py install#手动设置环境变量#vi /etc/profile#添加如下内容:#PY_EZ=/usr/local/python2.7#export PATH=$PY_EZ/bin:$PATH#source /etc/profile # 当前终端生效,reboot后才会完全生效#echo $PATH#查找easy_install#find / -name easy_install#ln -s /usr/local/python2.7/bin/easy_install /usr/bin/easy_install#easy_install pip#find / -name pip#
新闻热点
疑难解答