centostricks

Just another WordPress.com site

Run Multiple Python Version on a Single system, without altering System Python


Run Multiple Python Version on a Single system, without altering System Python

  1. wget http://www.python.org/ftp/python/2.7/Python-2.7.tar.bz2
  2. tar -xvjf Python-2.7.tar.bz2
  3. cd Python-2.7

Dependency required :

  1. yum install readline-devel
  2. yum install gdbm-devel
  3. yum install sqlite-devel
  1. ./configure –prefix=/usr/local/python2.7
  2. make
  3. make install

This installs python on a separate folder under /usr/local/python2.7

Now Once Python is installed, we can configure particular users to use the latest version of python :

$ vim ~/.bashrc

  1. User specific aliases and functions
    alias python=’/usr/local/python27/bin/python’

$ python
Python 2.7 (r27:82500, Mar 22 2011, 13:20:42)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: