From: Larry Martell Date: January 9 2012 9:58pm Subject: Re: Problem installing python MySQLdb on Mac OS X Version 10.5.8 List-Archive: http://lists.mysql.com/mysql/226577 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon, Jan 9, 2012 at 2:21 PM, Larry Martell wro= te: > Some may consider this slightly off-topic, but I'm out of places to > turn to, so I'm hoping someone here can help me. > > > I am having no luck with getting the python module MySQLdb to work on > my Mac. I am getting the dreaded 'wrong architecture' message when I > try to import the module. I googled this, and found this page: > > http://stackoverflow.com/questions/3061277/python-mysql-wrong-architectur= e-error > > Following the instructions there I found that I did indeed have the 64 > bit MySQL and a 32 bit python. I rectified that by deleting the 64-bit > install and then installing the 32-bit. Here's confirmation of that: > > $ python -c 'import platform; print platform.platform()' > Darwin-9.8.0-i386-32bit > > $ ls -l /usr/local/mysql > lrwxr-xr-x =C2=A01 root =C2=A0wheel =C2=A024 Jan =C2=A08 22:09 /usr/local= /mysql -> > mysql-5.5.19-osx10.5-x86 > > I rebuilt and reinstalled, but no joy. I added the env vars to my > .profile as suggested on that web page: > > PATH=3D"/usr/local/mysql/bin:${PATH}" > export PATH > export DYLD_LIBRARY_PATH=3D/usr/local/mysql/lib/ > export VERSIONER_PYTHON_PREFER_64_BIT=3Dno > export VERSIONER_PYTHON_PREFER_32_BIT=3Dyes > export ARCHFLAGS=3D"-arch i386" > > Sourced my .profile, rebuilt and reinstalled, same error. > > I'm thinking that perhaps something from the build I did when I had I > the 64-bit MySQL is getting left behind and messing up the new build. > But I don't know what that could be. I solved this, and this is exactly what it was. Although I was doing a 'sudo python setup.py clean' between builds, it was not removing everything. I did a 'sudo rm -rf build/*', then rebuild and reinstall, and this error went away.