Tag Archives: install

How to install a new version of python in RHEL 6

So, if you have RHEL 6, you might be stuck with Python 2.6.  But, not really.  Even though you might not be able to install a new version of python using yum, you can still download a new version of python and install it in your environment.  Now, you can install it and replace the current version or you can install another version and have two python in your system.

  1. Install GCC by typing
  2. Go to
  3. Now, let’s download a release from python.org. In this example we will be using Python 3.5.0.

  4. Let’s compile

  5. Let’s build the package

  6. Now, to install it you have two options.  You can either overwrite the python executable or you can install as concurrent instance.
    1. If you want to overwrite the OS python executable

    2. If you want to install concurrent (not overwritting the OS executable)

  7. Now let’s link it so others could use it

  8. Now test it by invoking the following command

    You should have the following result

  9. If you get that result let’s continue, otherwise look back and see what step you missed.
  10. Now that you have python 3.5 install along with 2.7, you might want to install pip to handle package installations.
  11. In order to do that, let’s first download pip.

  12. Now, let’s install it

    If setuptools is not installed, get-pip.py will automatically install setuptools.

  13. To check pip if installed successfully

    You should have the following result

  14. If you want others to use pip with sudo command, you probably want to do this
  15. And there you go!  Now you have two python versions and two pip versions running concurrently on your OS.

Sources

https://www.python.org/

https://pip.pypa.io/en/stable/installing/

http://stackoverflow.com/questions/8087184/installing-python3-on-rhel

http://stackoverflow.com/questions/6587507/how-to-install-pip-with-python-3