I just spent longer than should be necessary on this. Again, for the sake of an as yet unknown traveller in these parts, a little advice.
First, don't try to build against MAMP. It seemed like a good idea to start with, but as soon as I didn't need xdebug for PHP any more the amusement started to wane quite quickly. Instead use (Apple's built in Apache 1.3 and) the
official MySQL packages. I had to (shudder) reboot afterwards because various paths, caches and what have you still pointed to the MAMP one but once that was done, no problem.
Secondly, there have been some changes in the build script for mysql-python and the hacks you'll see all over the net for 1.2.1-p1 (or something) are no longer necessary. So step 2 is to get the
1.2.2 source package straight from Sourceforge. I followed the instructions, vaguely, and built with "python setup.py build" then "sudo python setup.py install". You probably can build in just one step, the second one, but then you get lots of temporary files owned by root and therefore a pain to clear up.
Finally, and the tricky bit, the plugin (or egg or whatever you're supposed to call it) still won't go because it can't find the client library on the path. No idea if you're supposed to go in and mash the system wide path in /etc/profile so I merely symlinked the library it was complaining about to the appropriate directory.
DaveMBP:/usr/local/lib davep$ sudo ln -s /usr/local/mysql-5.0.45-osx10.4-i686/lib/libmysqlclient_r.15.dylib
Except as one line (this theme is growing old). Obviously when version numbers change you'll have to change with them too, but no rocket science there. Oh, and you can find all the installed mysql libraries by going to /usr and asking:
DaveMBP:/usr davep$ find . -name "libmysql*"
Don't use spotlight because it doesn't index the unixy bits.
I will blog about something that is not to do with fixing bits of Python ... soon!