Playing around with centos, and have been working to get python 2.6 installed.
(Centos defaults to 2.4)
I managed to download and install python 2.6 using:
sudo ./make altinstall
However, when I tried to install additional packages I hit a zlib error.
I remembered that sqlite3 was also an additional package and checked and that failed as well.
>>> import zlib
ImportError: No module named zlib
>>> import sqlite3
ImportError: No module named _sqlite3
I found this post which mentioned zlib-devel, and found that installing that and sqlite-devel did the job.
So just run:
sudo yum install zlib-devel
sudo yum install sqlite-devel
# change to python directory
sudo make altinstall
And now both modules can be loaded properly.
altinstall will automatically install python to be python2.6.
This allows you to maintain the 2.4 build that centos needs for various system tools.