Dependancies

If you are installing from source there are some minimum programs you must have installed. These commands were also only tested on a Centos 6.5 64 bit host.

yum install -y wget
yum groupinstall "Development Tools" -y
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel

Download the Python Source

mkdir ~/src
cd ~/src
wget --no-check-certificate https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tar.xz
tar vxf Python-2.7.9.tar.xz

Install alongside older python

There are many cases when you want to install an updated version of python but don’t have admin privileges. Here are the simple instructions, they assume you already have the build utils installed.

Python will be installed at /usr/local/bin/python2.7

cd ~/src/Python*
./configure --enable-unicode=ucs4 --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"
make
make altinstall

Install as default for most programs

There are many cases when you want to install an updated version of python but don’t have admin privileges. Here are the simple instructions, they assume you already have the build utils installed.

Python will be installed at /usr/local/bin/python

cd ~/src/Python*
./configure --enable-unicode=ucs4 --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"
make
make install

Install in Home Directory

There are many cases when you want to install an updated version of python but don’t have admin privileges. Here are the simple instructions, they assume you already have the build utils installed.

Python will be installed at /home/USERNAME/bin/python

cd ~/src/Python*
./configure --enable-unicode=ucs4 --prefix=$HOME --enable-shared
make
make install