How to install Python 2.7 on RHEL 5

Today, I was trying to install MeldMerge tool on RHEL 5 server and got errors as the system is running and using currently installed[easyazon_link asin=”1449355730″ locale=”US” new_window=”default” nofollow=”default” tag=”wn0d5-20″ add_to_cart=”default” cloaking=”default” localization=”default” popups=”default”] Python [/easyazon_link] 2.4 version. This application requires [easyazon_link asin=”1449357016″ locale=”US” new_window=”default” nofollow=”default” tag=”wn0d5-20″ add_to_cart=”default” cloaking=”default” localization=”default” popups=”default”] Python [/easyazon_link] 2.7, Python 2.4 is installed and available by default on RHEL 5 and we cann’t remove as other application’s are already using it. This tutorial will help you to install Python 2.7 without removing older versions. We will install [easyazon_link asin=”1490475575″ locale=”US” new_window=”default” nofollow=”default” tag=”wn0d5-20″ add_to_cart=”default” cloaking=”default” localization=”default” popups=”default”] Python [/easyazon_link] 2.7 side by side on the system and you will be able to use both of them.

su
cd /usr/src
wget https://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz --no-check-certificate
tar -zvf 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

[easyazon_link asin=”1449319793″ locale=”US” new_window=”default” nofollow=”default” tag=”wn0d5-20″ add_to_cart=”default” cloaking=”default” localization=”default” popups=”default”] Python [/easyazon_link] 2.7.6 is now installed on the system in /opt/python2.7 directory and is ready to be used. Before you can use this new version for you app, you will need to export the PATH into new Python install. If you want to keep it as default-permanent add it into your .bashrc file.

Here is how to export PATH and point to the right directory

export PATH=$PATH:/opt/python2.7/bin/

Done!

[easyazon_block add_to_cart=”default” align=”left” asin=”1449340377″ cloaking=”default” layout=”left” localization=”default” locale=”US” nofollow=”default” new_window=”default” tag=”wn0d5-20″]

Leave a Reply