After getting a new macbook I gave up on macports in favor of homebrew because it uses Xcode and the default python installations for everything.

However, for some reason I can’t get python2.5 in a virtualenv to compile/install MySQLdb correctly. I always get the following error:

.python-eggs/MySQL_python-1.2.3-py2.5-macosx-10.6-i386.egg-tmp/ mach-o, but wrong architecture

The solution is to use python2.6, which does work, even in virtualenv. I suppose it is one of those things I’ll have to live with unless I have more time to figure it out.