I've wasted too much time trying to make MySQLdb work with Python 2.5, several times now.
Python 2.5 on OS X 10.6+ is 32=bit. Everything else is probably (depending on your system) 64-bit.
If you see the error:
Traceback (most recent call last):
...
import MySQLdb
File "/Users/cole/Library/Python/2.5/site-packages/MySQLdb/__init__.py", line 19, in <module>
import _mysql
ImportError: dlopen(/Users/cole/Library/Python/2.5/site-packages/_mysql.so, 2): Library not loaded: /usr/local/lib/libmysqlclient.18.dylib
Referenced from: /Users/cole/Library/Python/2.5/site-packages/_mysql.so
Reason: no suitable image found. Did find:
/usr/local/lib/libmysqlclient.18.dylib: mach-o, but wrong architecture
/usr/local/lib/libmysqlclient.18.dylib: mach-o, but wrong architecture
Many people have similar problems. To fix (use Homebrew):
pip uninstall MySQL-python
brew uninstall mysql
brew install mysql --universal
pip install MySQL-python
Note that Homebrew does NOT seem to preserve the --universal flag when you upgrade. If you start to see the problem again, that might be why.