Skip to main content

Installing Python 2.7 on CentOS 6.x

As a preparation for next post about Junos PyEZ, a short post on how to install Python 2.7 on CentOS 6.x. CentOS 6.x repos only install Python 2.6, so this guide will help you to install Python 2.7 next to the Python 2.6 NOT overwriting the older version. Do everything as a super user.

1. Install development toolkit for CentOS (this is really cool as you do not have to hunt and install all the needed prerequisites after this)

2. Install other necessary packages not included in the previous set

3. Due to Python 2.7 not being available directly from CentOS repos we will need to compile and install it from source. 2.7.9 was the newest version of 2.7 release stream during the time of writing.

4. Decode and extract the archive

5. Change to Python directory and compile the source

6. Install using “altinstall” to NOT overwrite the (possibly) already installed Python version

7. Install setuptools (which is prerequisite for PIP). PIP is a Python package manager, which makes installation of Python modules really easy.

8. Install pip

That’s it! Now you are ready to use Python 2.7 and install Junos PyEZ which I will be covering in the next post.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.