0

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 setup.py install

it says

Traceback (most recent call last):
File "setup.py", 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

setuptools-0.6c11-py2.6.egg

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.

/usr/share/doc/zlib-1.2.3
/usr/share/doc/zlib-1.2.3/README
/var/cache/yum/base/packages/zlib-devel-1.2.3-4.el5.x86_64.rpm

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

/usr/local/bin/

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

readline-devel
sqlite-devel
zlib-devel
openssl-devel

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.

1 Answer 1

1

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

6
  • 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, 2011 at 11:50
  • Exactly the same way you did it the first time. Oct 29, 2011 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, 2011 at 11:53
  • it is saying configure: WARNING: unrecognized options: --with-zlib
    – Astha
    Oct 29, 2011 at 12:09
  • i tried doing wget python.org/ftp/python/2.6.6/Python-2.6.6.tgz tar -zxvf Python-2.6.6.tgz cd Python-2.6.6 ./configure --with-zlib=/usr/include
    – Astha
    Oct 29, 2011 at 12:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .