top of page
Recent Posts

How to Install python 2.7 on Red Hat Enterprise Linux 5

Python 2.7 is not available in the Red Hat repository on RHEL 5, and the Python installation activities are different in RHEL 5. We can install it from the Python source code.

Step 1: We need to download the Python source code from the

# cd /usr/src
# wget --no-check-certificate

Note: if there is no internet connectivity in the target system, You can download it from your PC/Laptop and copy it to your target system.

# tar -xzvf Python-2.7.6.tgz
# rm -rf Python-2.7.6.tgz
# cd Python-2.7.6
# ./configure --prefix=/opt/python2.7 --enable-shared
# make
# make altinstall

Step 2: Re-link the python program and the libraries with the python2.7, as below:

# mv /usr/bin/python /usr/bin/python_org
# ln -s /opt/python2.7/bin/python2.7 /usr/bin/python
# ln -s /opt/python2.7/lib/ /usr/lib64/
# ln -s /opt/python2.7/lib/python2.7 /usr/lib64/ 

Step 3: Verify the current python version.

# python -V
Python 2.7.6

There are lots of applications still running on the RHEL 5 Operating System, and you might need to install python 2.7 on that for certain scenarios. hope this document will help you.

51 views0 comments