Showing posts with label UPG. Show all posts
Showing posts with label UPG. Show all posts

Sunday, May 24, 2020

How To Install an Old Version of Python on CentOS 7 without messing the default Python 2.7.x version installed

Ok this is how i install old Python 2.6.4 on a specific folder in my CentOS 7 without messing the Python 2.7.5 (default) that was installed in it.

What i want to do:
1. I am trying to run the UPG python script but somehow its binary strictly want to use python 2.6.4 or else it won't run
2. CentOS 7 comes with Python 2.7.x with it and i believe CentOS requires this version to be able to run its python scripts
3. So i need to be able to install Python 2.6.4 on a separate folder without messing with the default python version installed which is 2.7.x

What to do:


  1. 1. download python 2.6.4 source code package: https://www.python.org/downloads/release/python-264/
  2. download the tar file of course.
  3. unpack in any folder in your CentOS system but of course, you install it in preferred location /opt/ltx because UPG script refers to #!/opt/ltx/Python-2.6.4/bin/python 
  4. make sure you login as root
  5. Assuming you unpack it in /opt/ltx, cd to /opt/ltx/Python-2.6.4
  6. run configure like this >./configure --prefix=/opt/ltx/Python-2.6.4/.
    • this make install script to install the binaries and include files to /opt/ltx/Python-2.6.4/
  7. then finally >make install
  8. you can now see  /opt/ltx/Python-2.6.4/bin/python
  9. within this folder, you can do >python --version and the version will be 2.6.4
  10. however, doing >python --version on any other folder will show 2.7.x which means the default is still 2.7.x unless your script such as UPG strictly points to  /opt/ltx/Python-2.6.4/bin/ folder