Mac Lion x64bit Install Python Mysql on python2.7

Posted on September 03, 2011

I’ve been struggling with installation of Python Mysql.

Here is my setup procedure.

Install Mysql 5.5.15 x32 first

In ~/.bash_profile, add
# let python run as 32 bit
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/
export VERSIONER_PYTHON_PREFER_64_BIT=no
export VERSIONER_PYTHON_PREFER_32_BIT=yes

then,
defaults write com.apple.versioner.python Prefer-32-Bit -bool yes

Download MySQL_python-1.2.3-py2.7
ARCHFLAGS=’-arch i386′ python setup.py build
sudo ARCHFLAGS=’-arch i386′ python setup.py instal

All done

My Question is that should python mysql itself provide better solution for the installation? Anyway, it’s open source.