A colleague got this error message when trying to use MySQLdb from Django:
[...]
ImproperlyConfigured("Error loading MySQLdb module: %s" % e) django.core.exceptions.ImproperlyConfigured:
Error loading MySQLdb module: dlopen(/Users/roy/.python-eggs/MySQL_python-1.2.3c1-py2.5-macosx-10.5-i386.egg-tmp/_mysql.so, 2):
Symbol not found: _mysql_affected_rows
Referenced from: /Users/roy/.python-eggs/MySQL_python-1.2.3c1-py2.5-macosx-10.5-i386.egg-tmp/_mysql.so Expected in: dynamic lookup
He's using OS X 10.5, Python 2.5 (arriving with OS X), MySQL 5.1 & MySQLdb 1.2.3c1.
Any idea how to attack this?
Try to run:
Note: If you have any errors of missing symbols while compiling, you need to have mysql development libs to compile it.
On Linux it's easy to install it:
or:
On Mac you probably need to download MySQL Connector and then you may have to pass in a --with-mysql-libs option to point to the directory when the C libraries are unpacked to. Or you can try to put the libraries in the default directory: /usr/lib64/mysql