1. Now tar package
http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
2. Unzip and install
tar -zxvf Python-2.7.3.tgz
Create an installation directory
mkdir /usr/local/python2.7.3
compile, install
cd Python-2.7.3
./configure --prefix=/usr/local/python2.7.3
make
make install
3. Change the original /usr/bin/python link to another name
mv /usr/bin/python /usr/bin/python_old
4. Create a link to the new version of python
ln -s /usr/local/python2.7.3/bin/python2.7 /usr/bin/python
5、python
-bash-4.1# python
Python 2.7.3 (default, Nov 15 2016, 03:04:10)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
6. After the system Python soft link points to the Python 2.7 version, yum cannot work properly because yum is not compatible with Python 2.7. We need to specify the Python version of yum
#vi /usr/bin/yum
Put #!/usr/bin/python at the head of the file
Change to
#!/usr/bin/python2.6.6
7. Configure iBus
#vi /usr/bin/ibus-setup
#vi/usr/libexec/ibus-ui-gtk
Find the line of exec python, change exec python to exec python2.6, save and exit