Virtualenv no module named zlib

前端 未结 2 734
栀梦
栀梦 2021-02-05 16:44

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 installati         


        
2条回答
  •  臣服心动
    2021-02-05 17:24

    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.

提交回复
热议问题