Ideally, you should NOT change the default python on your systems. Too many things are dependent on it. HOwever, you can install a newer version and use it in your scripts. Here's is an abridged version of how to do this
DOWNLOAD AND INSTALL PYTHON 2.7
The Fedora system comes stock with Python 2.6. As I've learned, you do not want to remove/overwrite 2.6 as other system tools use it. So you will want to install it as an "alternate" version.
First download Python 2.7 from the Python Org download website!. At the time of this writing, the latest release is Python 2.7.6. All of these instructions assume you are doing these as root. You can alternatively use sudo.
NOTE: the final step is to use make altinstall. This is important.
wget http://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz
tar xvzf Python-2.7.6.tgz
cd Python-2.7.6
./configure --prefix=/usr/local
make
You can verify the installation:
[root@centos6_4_32 ~]# python2.7 --version
Python 2.7.6
make altinstall
DOWNLOAD AND INSTALL PIP
The pip tool is used to install Python modules (a.k.a. "packages", "libraries", etc.). You need to install the latest set of tools and ensure they are installed in the Python 2.7 area of you system. You do NOT want to use the stock pip tool since it will install in the Python 2.6 area. The following instructions were taken from this website. At the time of this writing, the latest version of pip is 1.4.1.
# copy the setup scripts
wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py
# now make sure you use python2.7 when installing
# these tools!
python2.7 ez_setup.py
python2.7 get-pip.py
NOTE: Ensure that you are using python2.7 when running these scripts, and not just python.
You can verify the installation:
[root@centos6_4_32 ~]# pip-2.7 --version
pip 1.4.1 from /usr/local/lib/python2.7/site-packages (python 2.7)
NOTE: use pip-2.7 and not just pip.
Source: http://forums.juniper.net/t5/Network-Automaniac/Installing-Python-2-7-on-CentOS-6/ba-p/217295