no módulo llamado zlib

Primero, por favor tengan paciencia conmigo. Me cuesta decirles a otros mi problema y este es un hilo largo ...

Estoy usando pythonbrew para ejecutar múltiples versiones de python en Ubuntu 10.10. Para instalar pythonbrew y cómo funciona, consulte este enlace a continuación

http: //www.howopensource.com/2011/05/how-to-install-and-manage-different-versions-of-python-in-linux

Después de leer un par de hilos de stackoverflow, finalmente encontré el archivo llamado Setup en este directorio: ~ / .pythonbrew / pythons / Python-2.7.1 / lib / python2.7 / config

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

Descomenté la última línea, luego corrípython -v de nuevo. Sin embargo, recibí el mismo error cuando intentéimport zlib, así que supongo que tengo que hacer algo para instalar zlib en la biblioteca.

Pero no tengo idea de lo que tengo que hacer. ¿Alguien puede dirigirme en la dirección correcta? ¡Muchas gracias

Estoy haciendo esto porque quiero usar diferentes versiones de python en diferentes virtualenv que creé. Cuando hicevirtualenv -p python2.7 No recibí ningún módulo llamado zlib.

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 <module>
    import zlib

ImportError: No module named zlib

EDITA

Tengo que instalar 2.7.1 agregando --force.

Estoy desarrollando Django, y necesito algunos de estos módulos faltantes, por ejemplo sqlite3, y para crear mi virtualenv definitivamente necesito zlib. Si solo uso el sistema predeterminado (2.6.6), no tengo ningún problema.

ara hacer esto con el sistema predeterminado, todo lo que necesito hacer es

virtualenv --no-site-packages testenv

¡Gracias

(2da edición)

También instalé 3.2 y lo probé sin problemas, así que supongo que mi problema se reduce a cómo instalar los módulos faltantes.

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.

Respuestas a la pregunta(8)

Su respuesta a la pregunta