Bounding Unicorns

How To Build Python 2.5 With zlib, ssl And sha256 Modules For Virtualenv

For whatever reason Python 2.5 by default builds without a bunch of modules that virtualenv needs.


The first one is zlib, the recipe for it is here.


Then _sha256 is missing, which I fixed analogously to zlib as follows:

echo _sha256 sha256module.c >> Modules/Setup

While we are here _sha512 module can be enabled the same way:

echo _sha512 sha512module.c >> Modules/Setup


To get ssl module working I had to uncomment the lines around it and also uncomment *shared* line near the top of Modules/Setup.

The following sed command will do the job:

sed -i -e '/^#SSL/,/^$/s/^#//' -e 's/^#*shared*/shared/' Modules/Setup

See also here.

Now virtualenv should work.