MacOS X 10.3.9, MySQLdb 1.2.2, Python 2.5
July 24, 2007

Another nice little gotcha for you:

If you get this error after building and installing MySQLdb 1.2.2 on 10.3.9:

ImportError: dlcompat: dyld: /Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/Contents/MacOS/Python can't open library: /usr/local/mysql/lib/mysql/libmysqlclient_r.15.dylib  (No such file or directory, errno = 2)

have a look in your /usr/local/mysql/lib/ folder. You may discover, as I did, that the library it’s looking for is in that folder, and not in a subfolder called mysql.

I spent ages on this before realising what was wrong.

The solution is simple, just make a mysql subfolder and alias (or copy) the library into it.

Aaaagh!