Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i have to install mysqldb module of python in my centos server. i have 2 versions of python

1. 2.4.3 the default one
2. 2.6 which i installed

i want to install mysqldb module for 2.6 version of the python. i installed it from here but when i am on the line

python2.6 install

it says

Traceback (most recent call last):
File "", line 5, in <module>
from setuptools import setup, Extension
ImportError: No module named setuptools

so i went for installing setup tools from here.using the command


because i installed 2.6 python so i installed this rpm. but when i execute this command it says

Traceback (most recent call last):
File "<string>", line 1, in <module>
zipimport.ZipImportError: can't decompress data; zlib not available

but when i did locate command i do find the package and rpm installed for zlib.


can any one please help me in this. I exactly want to install mysqldb module for python 2.6 i installed on my


directory. I searched net and tried everything. i also installed all


and tried again but no success. Now on every try it says that zlib installed nothing to do.(when i try it from yum).

any help or idea will be highly appreciated.

share|improve this question
up vote 1 down vote accepted

Make sure that your python2.6 installation is compiled with zlib support.

share|improve this answer
i already compiled it and deleted the extracted folder and .tar file too month ago. now how can i re-compile it for this zlib ?? – Astha Oct 29 '11 at 11:50
Exactly the same way you did it the first time. – Ignacio Vazquez-Abrams Oct 29 '11 at 11:51
Try with this for example: ./configure --with-zlib=/usr/include --prefix=/your/prefix/choice To be able to compile python with zlib support, you must have zlib-devel installed...from what you have wrote, you installed the zlib-devel package after configure/compile python2.6. So you need to recompile. – gryzli Oct 29 '11 at 11:53
it is saying configure: WARNING: unrecognized options: --with-zlib – Astha Oct 29 '11 at 12:09
i tried doing wget tar -zxvf Python-2.6.6.tgz cd Python-2.6.6 ./configure --with-zlib=/usr/include – Astha Oct 29 '11 at 12:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.