What are the packages/libraries I should install before compiling Python from source?

There are a few more. Normally, configure should remind you if anything is missing, and a few of them are optional. Here's my list:

build-essential
libncursesw5-dev
libreadline-gplv2-dev
libssl-dev
libgdbm-dev
libc6-dev
libsqlite3-dev
libbz2-dev
libffi-dev

You should be able to install all build dependancies for Python with the build-dep option in apt-get

sudo apt-get build-dep python

    build-dep
       build-dep causes apt-get to install/remove packages in an attempt
       to satisfy the build dependencies for a source package.

if you want to use Google App Engine SDK:

  • opensll
  • libssl-dev build-essential

libsqlite3-dev zlib1g zlib1g-dev

PIL 1.1.7

:)