Upgrading Python in server

Use the following steps to upgrade python in your server.

1. Download the latest version and extract.

cd /usr/src/

wget –no-check-certificate https://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz

tar -zvxf Python-2.7.6.tgz

cd Python-2.7.3

2. Give the new installation directory as prefix and install.

./configure –prefix=/usr/local/Python-2.7

make

make install

3. Correct the binary. The default binary /usr/bin/python will be still showing the old version.

mv /usr/bin/python /usr/bin/python.bkp

ln -s /usr/local/Python-2.7/bin/python /usr/bin/python

Now python will be showing the latest version.

/usr/bin/python
Python 2.7.6 (default, May 12 2014, 07:20:17)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux2

 

Leave a Reply

Your email address will not be published. Required fields are marked *