Skip to content

Instantly share code, notes, and snippets.

@mikeclarke
Created December 12, 2010 22:05
Show Gist options
  • Save mikeclarke/738389 to your computer and use it in GitHub Desktop.
Save mikeclarke/738389 to your computer and use it in GitHub Desktop.
Installing python2.6 from source
# Create a directory to store all the sources we will need to compile/install
mkdir ~/src
cd ~/src
wget http://www.python.org/ftp/python/2.6.4/Python-2.6.4.tgz
tar xzvf Python-2.6.4.tgz
cd Python-2.6.4
yum install apr-devel zlib-devel postfix mod_ssl openssl-devel sqlite sqlite-devel bzip2-devel
# These switches ensure python is compiled with threading, as a shared library, and reference zlib
./configure --with-threads --enable-shared --with-zlib=/usr/include
# This step begins the actual compilation - watch for errors and warnings
make
# *IMPORTANT* - this next step ensure that your original python executable is not overwritten (python 2.4).
make altinstall
# The libraries need to be linked back to a location that ldconfig can locate
ln -s /usr/local/lib/libpython2.6.so /usr/lib
ln -s /usr/local/lib/libpython2.6.so.1.0 /usr/lib
ln -s /usr/local/lib/libpython2.6.so /usr/local/lib/python2.6/config/libpython2.6.so
# Load in the new python2.6 shared libraries
/sbin/ldconfig -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment