MySQLdb within python2.5 virtualenv

Posted by wizard on Stack Overflow See other posts from Stack Overflow or by wizard
Published on 2010-02-21T02:28:10Z Indexed on 2010/03/28 15:03 UTC
Read the original article Hit count: 417

Filed under:
|
|

I have a Fedora 11 box with MySQL server. Fedora 11 uses python 2.6 internally and python 2.6 is automatically installed on the box. I have created a python virtual-env for version 2.5.5, so that I can run turbogears 1.x application. I have MySQLdb rpm installed on the box (and it works fine with python 2.6).

When I import MySQLdb from within python version 2.6 it imports is successfully. When I import MySQLdb from within the python 2.5.5 virtual-env the import fails (because I have installed virtual-env with --no-site-packages). So, I have to install MySQLdb python as a local package (local to virtual-env).

'easy_install MySQL-python' within the virtual env fails. It downloads the MySQL-python-1.2.3.c1.tar.gz/download, but the 'python setup.py build' fails with error. The same problem occurs when building the MySQL outside of virtual-env.

Is the 'python setup.py build' for MySQL-python trying to link to a library (and am I missing some library)? Or is the downloaded code missing some header files (unlikely)?

Thanks.

© Stack Overflow or respective owner

Related posts about python

Related posts about virtualenv