Python 2.4 is used by default for yum on centOS 5.x. Replace that with a new version and yum will no longer work. Do not upgrade the default python. You'll see that I place python 2.7 in /opt/bin/
yum groupinstall "Development Tools"
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
tar xvfz Python-2.7.3.tgz
cd Python-2.7.3
#sqllite module does not build: I hope this gist is still around..
curl -sk https://raw.github.com/gist/2727063/ | patch -p1
./configure --enable-ipv6 --prefix=/opt/bin/python2.7 --with-threads --enable-shared --enable-unicode
make
make install
su -c 'ln -s /opt/bin/python2.7/lib/libpython2.7.so /usr/lib'
su -c 'ln -s /opt/bin/python2.7/lib/libpython2.7.so.1.0 /usr/lib'
su -c '/sbin/ldconfig -v'
cd /opt/bin/python2.7/lib
export PATH=`pwd`:$PATH
cd /opt/bin/python2.7/bin
export PATH=`pwd`:$PATH
#needed --no-check-certificate for this next wget..
wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz#md5=7df2a529a074f613b509fb44feefe74e --no-check-certificate#read it
tar xf setuptools-0.6c11.tar.gz
cd setuptools-0.6c11
more README.txt
more EasyInstall.txt#read the multiple python versions bit.
python2.7 setup.py install
easy_install-2.7 pip
pip-2.7 install virtualenv
pip-2.7 install anything else you need
echo done.
done.
No comments:
Post a Comment