1. Download Python source Package
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
2. Unzip
TAR-XJF python-2.7.3.tar.bz2
3. Create a new Python directory
mkdir/usr/local/python2.7
4. Compiling the installation
Tar XF python-2.7.3.tgz cd Python-2.7.3./configure--prefix=/usr/local/python2.7 make && make install
5. The old version is not covered at this time, you can change the old Python version to a different name first
Mv/usr/bin/python/usr/bin/python_old
6. Create a like for the new version of Python
Ln-s/usr/local/python2.7/bin/python2.7/usr/bin/python
7. Test, enter Python at the command line to display the current Python version information
[[email protected] ~]# python python 2.7.3 (default, Nov, 16:58:04) [GCC 4.4.7 20120313 (Red Hat 4.4.7-16)] on Li Nux2 Type ' help ', ' copyright ', ' credits ' or ' license ' for more information. >>>
This article is from the "Potato" blog, please be sure to keep this source http://zhaoyulin.blog.51cto.com/11665101/1873138
Python upgrade to 2.7 under Linux