Skip to content Skip to sidebar Skip to footer

Virtualenv No Module Named Zlib

I'm trying to create Python 2.7 virtual env under Python2.6, I'm simply running: virtualenv --python=python27 #python27 correctly leads to my python installation in /opt/python2.7/

Solution 1:

Your Python must have been compiled without Python support, most likely because zlib-devel was not installed when it was compiled. Looking at the output of make or make install you should see something like the following (taken from a build of Python 2.7.6):

Python build finished, but the necessary bits to build these modules were not found:
[...]        zlib            
To find the necessary bits, look in setup.py in detect_modules() for the module's name.

To solve your problem you need to install zlib-devel (if it is not installed) and recompile or reinstall Python.

Solution 2:

zlib is a Python module that interfaces with the zlib library on your computer. It is part of the standard library, so it should be on all Python 2.7 installs.

If it's not, in your case, then that likely means that your version of Python was compiled without zlib support for some reason. I can't imagine why, unless it's related to something you did to enable the use of older versions of zlib. I think you will need to find another Python package, or compile Python yourself.

Post a Comment for "Virtualenv No Module Named Zlib"