View Full Version : python can't import MySQLdb

11-12-2005, 09:56 AM
I'm trying to get TurboGears (http://www.turbogears.org) to work, but it is crapping out with the error No module named MySQLdb when I run the tg-admin sql create command. I figure it is because it MySQLdb is not installed. Does anyone have any pointers on how to get MySQLdb installed?

11-15-2005, 05:24 PM
You need to install MySQLdb module, from http://sourceforge.net/projects/mysql-python.

I am also trying Turbogear.

11-15-2005, 05:59 PM
By the way, I met some compile and link error during the installation of mysql-python. The reason is mysql-python's setup.py uses mysql_config to find
all compliler and linker options, but my VPS' mysql_config output seems not correct .:confused: So I temporarily modified setup.py like following:
include_dirs = [ i[2:] for i in config('include') ]
include_dirs.append('/usr/local/mysql/include') # added
library_dirs = [ i[2:] for i in libs if i.startswith("-L") ]
library_dirs.append('/usr/local/mysql/lib') # added

I use WH's mysql4.1.9 installed from site manager, anyone else met same problem?

11-15-2005, 11:28 PM
I was running into the same problem. That fixed it. Thanks! :D