title: no module named zlib
body: <p>First, please bear with me. I have hard time telling others my problem and this is a long thread...</p>
  
  <p>I am using pythonbrew to run multiple versions of python in Ubuntu 10.10. 
  For installing pythonbrew and how it works, please refers to this link below</p>
  
  <p><a href="http://www.howopensource.com/2011/05/how-to-install-and-manage-different-versions-of-python-in-linux/">http://www.howopensource.com/2011/05/how-to-install-and-manage-different-versions-of-python-in-linux/</a></p>
  
  <p>After reading a couple stackoverflow threads, I finally found the file called Setup under this directory:  <strong>~/.pythonbrew/pythons/Python-2.7.1/lib/python2.7/config</strong></p>
  
  <pre><code>In this Setup file I see 
  # Andrew Kuchling's zlib module.
  # This require zlib 1.1.3 (or later).
  # See http://www.gzip.org/zlib/
  # zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
  </code></pre>
  
  <p>I uncommented the last line, then I ran <strong>python -v</strong> again. However, I received the same error when I tried <strong>import zlib</strong>, so I guess I have to do something to install zlib into the lib. </p>
  
  <p>But I am clueless about what I need to do. Can someone please direct me in the right direction??? Thank you very much!</p>
  
  <p>I am doing this because I want to use different version of python in different virtualenv I created. 
  When I did  <strong>virtualenv -p python2.7</strong> I received no module named zlib. </p>
  
  <pre><code>jwxie518@jwxie518-P5E-VM-DO:~$ virtualenv -p python2.7 --no-site-packages testenv
  
  Running virtualenv with interpreter /home/jwxie518/.pythonbrew/pythons/Python-2.7.1/bin/python2.7
  
  Traceback (most recent call last):
    File "/usr/local/lib/python2.6/dist-packages/virtualenv.py", line 17, in &lt;module&gt;
      import zlib
  
  ImportError: No module named zlib
  </code></pre>
  
  <hr>
  
  <p><strong>EDIT</strong></p>
  
  <p>I have to install 2.7.1 by appending --force.</p>
  
  <p>I am developing Django, and I need some of these missing modules, for example sqlite3, and to create my virtualenv I definitely need zlib. If I just use the system default (2.6.6), I have no problem.</p>
  
  <p>To do this with system default, all I need to do is</p>
  
  <pre><code>virtualenv --no-site-packages testenv
  </code></pre>
  
  <p>Thanks! </p>
  
  <hr>
  
  <p><strong>(2nd edit)</strong></p>
  
  <p>I installed 3.2 also and I tested it without problem, so I guess my problem comes down to how to install the missing module(s).</p>
  
  <pre><code>jwxie518@jwxie518-P5E-VM-DO:~$ virtualenv -p python3.2  testenv
  Running virtualenv with interpreter /home/jwxie518/.pythonbrew/pythons/Python-3.2/bin/python3.2
  New python executable in testenv/bin/python3.2
  Also creating executable in testenv/bin/python
  Installing distribute..................................................................................................................................................................................................................................................................................................................................done.
  Installing pip...............done.
  jwxie518@jwxie518-P5E-VM-DO:~$ virtualenv -p python3.2 --no-site-packages testenv
  Running virtualenv with interpreter /home/jwxie518/.pythonbrew/pythons/Python-3.2/bin/python3.2
  New python executable in testenv/bin/python3.2
  Also creating executable in testenv/bin/python
  Installing distribute..................................................................................................................................................................................................................................................................................................................................done.
  Installing pip...............done.
  </code></pre>