1. Cenots6.3 is installed with 2.6.6 by default. to update and upgrade, you must install gcc:
Yum-y install gcc
The system automatically downloads and installs gcc.
2. Download python 3.3.2 http://python.org/getit/
3. Decompress python 3.3.2
Tar-jxvf Python-3.3.2.tar.bz2
4. Go to the directory: cd Python-3.3.2.tar.bz2
Install python
./Configure
Make all
Make install
Now we have installed python, but after entering the shell, check the python version: python-V and find that python is 2.6.6. We need to establish a link.
5. Establish a soft connection to allow the system to use the new version of python by default,
Mv/usr/bin/python/usr/bin/python2.6
Ln-s/usr/local/bin/python3.3/usr/bin/python
Verify whether python points to the following:
Python-V
After pointing the default python to 3.3.2, yum cannot be used normally. Edit the yum configuration file:
Vi/usr/bin/yum
#! /Usr/bin/python #! /Usr/bin/python2.6 save and exit.
For earlier centos versions, modify it #! /Usr/bin/python2.4