Wednesday, July 23, 2014

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 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 .
Step 7: Install pip with Administrator rights
# python2.7
If setuptools (or distribute) is not already installed, will install setuptools for you. To upgrade an existing setuptools (or distribute), run
# pip install -U setuptools
# pip install numpy

No comments: