1 centos install python2.75 (centos6.3)
1 switch to root user 2 download tar package
wget http://www.python.org/ftp/python/2.7.5/Python-2.7.5.tgz
3 installation
tar -zxvf Python-2.7.5.tgz cd Python-2.7.5 ./configure --prefix=/usr/local/python27 make&&make install
4. Have you installed the SDK?
/usr/local/python27/bin/python
The Python version is 2.7.5.
Set software links
ln -s /usr/local/python27/bin/python /usr/bin/python27
Later, you can directly use python27 to use version 2.7.5. 2 is set to the default version.
mv /usr/bin/python /usr/bin/python-old ln -s /usr/local/python27/bin/python /usr/bin/python
Test again:
[root@bogon Python-2.7.5]# python Python 2.7.5 (default, Jul 22 2013, 22:14:28) [GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2 Type "help", "copyright", "credits" or "license" for more information.
In this way, when yum is used, an error is reported.
vim /usr/bin/yum
Modify the first line :#! /Usr/bin/Python-old input Yum again and it will be displayed normally.