Installing and Compiling Python 2.7.8 on CentOS 5


Step 1: Download the Python 2.7.8 from Python Site

Step 2: Use GCC44 to compile. If you have not done it, do

# yum install gcc44 gcc44-c++ gcc44-gfortran

Step 3: Update your alias in your  .bashrc

alias gcc='gcc44'

Step 4: Configure python 2.7.8

# cd python-2.7.8
# ./configure --prefix=/usr/local/python-2.7.8
# make -j 8
# make install

Step 5: Update the PATH and LD_LIBRARY_PATH in your .bashrc

export PATH=$PATH:/usr/local/python-2.7.8/bin.........
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/python-2.7.8/lib

Step 6: Download get-pip.py
For more information see pip installation site

Create a directory inside python2.7 directory and put pip in that directory

# mkdir /usr/local/python-2.7.8/pip
# wget https://bootstrap.pypa.io/get-pip.py .

Step 7: Install pip with Administrator rights

# python2.7 get-pip.py

If setuptools (or distribute) is not already installed, get-pip.py will install setuptools for you.
To upgrade an existing setuptools (or distribute), run

# pip install -U setuptools
# pip install numpy
Advertisements

2 thoughts on “Installing and Compiling Python 2.7.8 on CentOS 5

  1. Pingback: Compiling the python-igraph with Python 2.7 on CentOS 5 | Linux Cluster

  2. Pingback: Using Python 2 on JupyterHub | Linux Cluster

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