MySQLdb and bits

D

Dafydd Hughes

Hi there

This is my first post to the list - please forgive me if this has been
addressed elsewhere.

I'm running MySQL 32-bit in Snow Leopard, and had MySQLdb working well.
I switched to 64-bit, rebuilt MySQLdb, and again it worked fine within
Python, but had to switch back to 32 bit - I'm using a wrapper for
Python within Pure Data, and it forces Python to 32-bit.

So back to 32-bit. It works fine wrapped in Pd, but if I try import
MySQLdb from the terminal, I get:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.macosx-10.6-fat/egg/MySQLdb/__init__.py", line 19,
in <module>
File "build/bdist.macosx-10.6-fat/egg/_mysql.py", line 7, in <module>
File "build/bdist.macosx-10.6-fat/egg/_mysql.py", line 6, in
__bootstrap__
ImportError:
dlopen(/Users/dafydd/.python-eggs/MySQL_python-1.2.3c1-py2.6-macosx-10.6-fat.egg-tmp/_mysql.so,
2): no suitable image found. Did find:

/Users/dafydd/.python-eggs/MySQL_python-1.2.3c1-py2.6-macosx-10.6-fat.egg-tmp/_mysql.so:
mach-o, but wrong architecture

Is there a solution to this? I assume this is happening because Python's
trying to work 64-bit but MySQLdb was built 32. Am I way off base?

Thanks for any help.

cheers
dafydd
 
V

voidnothings

Hi there

This is my first post to the list - please forgive me if this has been
addressed elsewhere.

I'm running MySQL 32-bit in Snow Leopard, and had MySQLdb working well.
I switched to 64-bit, rebuilt MySQLdb, and again it worked fine within
Python, but had to switch back to 32 bit - I'm using a wrapper for
Python within Pure Data, and it forces Python to 32-bit.

So back to 32-bit. It works fine wrapped in Pd, but if I try import
MySQLdb from the terminal, I get:

 >>> import MySQLdb
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "build/bdist.macosx-10.6-fat/egg/MySQLdb/__init__.py", line 19,
in <module>
   File "build/bdist.macosx-10.6-fat/egg/_mysql.py", line 7, in <module>
   File "build/bdist.macosx-10.6-fat/egg/_mysql.py", line 6, in
__bootstrap__
ImportError:
dlopen(/Users/dafydd/.python-eggs/MySQL_python-1.2.3c1-py2.6-macosx-10.6-fat.egg-tmp/_mysql.so,
2): no suitable image found.  Did find:

/Users/dafydd/.python-eggs/MySQL_python-1.2.3c1-py2.6-macosx-10.6-fat.egg-tmp/_mysql.so:
mach-o, but wrong architecture

Is there a solution to this? I assume this is happening because Python's
trying to work 64-bit but MySQLdb was built 32. Am I way off base?

Thanks for any help.

cheers
dafydd

I got the same problem though in a different scenario. I'm trying to
setup my local django environment here and mysql_python fails on me.
Same "...mach-o, but wrong architecture" message. Anyone?
 
J

John Nagle

MySQLdb must match the Python in which it is installed, but
the MySQL server doesn't have to be of the same architecture as
the client. After all, the server and client don't even have to
be on the same machine.

John Nagle
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top