Installing MySQLdb on Mac OS X

sudo pip install mysql-python worked for me in 10.8.1.


try this in .bashrc or .bash_profile

PATH="/usr/local/mysql/bin:${PATH}"
export PATH
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/
export VERSIONER_PYTHON_PREFER_64_BIT=no
export VERSIONER_PYTHON_PREFER_32_BIT=yes

Ack. I feel your pain. I spent a really long time also trying to get MySQL working with Python 2.6 on Snow Leopard using a Macbook Air and had lots of architecture problems. What ended up solving it for me, was making sure both my Python and MySQL installations were using a 32 bit architecture like my Snow Leopard was.

I wrote about my solution here, so maybe that'll help:

http://www.markliu.me/2010/jun/09/mysql-and-python-on-32-bit-snow-leopard/

Good luck...