When building Python 3.2.3 from source on Ubuntu 12.04, the zlib module is not available.
I downloaded the official source distribution from python.org, and attempte
sudo apt-get install build-essential python-dev
Even though python-dev is for python2.7 it will still bring in all the necessary dependencies.
You will then need to do:
./configure make sudo make install
To rebuild python3