Thursday, September 20, 2012

Install python 2.7 using tar file

    cd /usr/local/src/
    wget http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tgz
    tar -zxvf Python-2.7.2.tgz
    cd Python-2.7.2
    ./configure --prefix=/opt/python2.7 --with-threads --enable-shared
    make
    make install


Once the python is installed separately export LD_LIBRARY_PATH=/usr/local/lib
path of the current python library.

If it doesn't work try locating the libpython and place it in the right path to make it work.

   --> ./configure --prefix=/usr/local/python2.7  --enable-shared
   --> make ; make install
   --> updatedb
   --> locate libpython2.7.so.1.0
   --> cp -r /usr/local/python2.7/lib/libpython2.7.so.1.0 /usr/lib
  -->  Add /usr/lib in /etc/ld.so.conf file
  -->   Type ldconfig command
   --> Add python path in the bash profile.

It works now !!

No comments: