centos 5.8升级python 2.4到2.7

centos 5.8系统中的python版本默认是2.4 ,升级到2.7需要手动编译安装

1. 安装python2.7依赖库 

     yum -y groupinstall 'Development Tools'
     yum -y install openssl-devel* ncurses-devel* zlib*.x86_64</pre>
     yum -y install bzip2 bzip2-devel bzip2-libs
2.  下载并安装python 2.7    http://python.org/ftp/python/2.7/

      

curl -O http://python.org/ftp/python/2.7/Python-2.7.tgz
tar xfz Python-2.7.tgz
cd Python-2.7
./configure
make && make install
which python
python -V
3. 安装 setuptools

curl -O http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg
chmod 775 setuptools-0.6c11-py2.7.egg
sh setuptools-0.6c11-py2.7.egg
安装后的路径为: /usr/local/lib/python2.7/site-packages/
4  安装python 模块pip

$ curl -O http://pypi.python.org/packages/source/p/pip/pip-1.0.tar.gz
$ tar xvfz pip-1.0.tar.gz
$ cd pip-1.0
$ python setup.py install 

你可能感兴趣的:(c,centos,python,tools)