mysql-python on Snow Leopard with MySQL 64-bit

Posted by Derek Reynolds on Super User See other posts from Super User or by Derek Reynolds
Published on 2010-03-26T23:14:54Z Indexed on 2010/03/26 23:23 UTC
Read the original article Hit count: 738

Filed under:
|
|
|
|

Can't seem to get mysql-python to work on Snow Leopard for the life of me.

Currently using the default version of python that ships with Snow Leopard (python 2.6.1). Installed MySQL 5.1.45 x86_64.

I download the source for mysql-python http://sourceforge.net/projects/mysql-python/ and compile with the following commands:

tar xzf MySQL-python-1.2.3c1.tar.gz
cd MySQL-python-1.2.3c1
ARCHFLAGS='-arch x86_64' python setup.py build
ARCHFLAGS='-arch x86_64' python setup.py install

And am getting the following error when I try to import:

Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "build/bdist.macosx-10.6-universal/egg/MySQLdb/__init__.py", line 19, in <module>

  File "build/bdist.macosx-10.6-universal/egg/_mysql.py", line 7, in <module>
  File "build/bdist.macosx-10.6-universal/egg/_mysql.py", line 6, in __bootstrap__
ImportError: dlopen(/Users/derek/.python-eggs/MySQL_python-1.2.3c1-py2.6-macosx-10.6-universal.egg-tmp/_mysql.so, 2): no suitable image found.  Did find:
/Users/derek/.python-eggs/MySQL_python-1.2.3c1-py2.6-macosx-10.6-universal.egg-tmp/_mysql.so: mach-o, but wrong architecture

Any ideas? Or the best route for starting over.

© Super User or respective owner

Related posts about python

Related posts about mysql