title: building Python from source with zlib support
body: <p>When building Python 3.2.3 from source on Ubuntu 12.04, the zlib module is not available.</p>
  
  <p>I downloaded the official source distribution from python.org, and attempted to build and install it with the following commands.</p>
  
  <pre><code>tar xfa Python3.2.3.tar.bz2
  cd Python-3.2.3
  ./configure --prefix=/opt/python3.2
  make
  sudo make install
  </code></pre>
  
  <p>The make command output includes the following.</p>
  
  <pre><code>Python build finished, but the necessary bits to build these modules were not found:
  _curses            _curses_panel      _dbm            
  _gdbm              _sqlite3           _ssl            
  _tkinter           bz2                readline        
  zlib                                            
  </code></pre>
  
  <p>After running <code>make install</code> and starting the interpreter, the <code>zlib</code> module cannot be imported.</p>
  
  <p>I confirmed that the <code>zlib1g-dev</code> package is installed on my system.</p>
  
  <p>I also found <a href="https://stackoverflow.com/questions/6169522/no-module-named-zlib">this similar question</a>, which suggests adding the <code>--with-zlib</code> flag to the <code>./configure</code> command.  However, that returns an error that it is an unrecognized option and has no effect.</p>