There is definitely an architectural mismatch going on, though. Nothing really
I can do about that. If you are using a 64-bit Python, you need 64-bit MySQL,
and that's all there is to it.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
OK... that doesn't help me. I have the same problem. It's not a 32/64 bit
issue. Tried the macports approach, made no difference for me. This is on
10.5.8 as well.
Hi,
I have so many problem to install MySQLdb on Mac OS X 10.5.8.
The real problem occurs during the build phase (see message below).
Python is standard Python2.6 for Mac OS and MySQL is a 32-bits 5.1
distribution.
Help me please : I'm quite desesperate !!!
gcc -arch i386 -arch ppc -arch ppc64 -arch x86_64 -isysroot
/Developer/SDKs/MacOSX10.5.sdk -bundle -undefined dynamic_lookup
build/temp.macosx-10.5-universal-2.6/_mysql.o
-L/usr/local/mysql-5.1.40-osx10.5-x86/lib -lmysqlclient_r -lz -lm -lmygcc -o
build/lib.macosx-10.5-universal-2.6/_mysql.so
ld warning: in build/temp.macosx-10.5-universal-2.6/_mysql.o, file is not of
required architecture
ld warning: in /usr/local/mysql-5.1.40-osx10.5-x86/lib/libmysqlclient_r.dylib,
file is not of required architecture
ld warning: in /usr/local/mysql-5.1.40-osx10.5-x86/lib/libmygcc.a, file is not
of required architecture
ld warning: in build/temp.macosx-10.5-universal-2.6/_mysql.o, file is not of
required architecture
ld warning: in /usr/local/mysql-5.1.40-osx10.5-x86/lib/libmysqlclient_r.dylib,
file is not of required architecture
ld warning: in /usr/local/mysql-5.1.40-osx10.5-x86/lib/libmygcc.a, file is not
of required architecture
ld warning: in build/temp.macosx-10.5-universal-2.6/_mysql.o, file is not of
required architecture
ld warning: in /usr/local/mysql-5.1.40-osx10.5-x86/lib/libmysqlclient_r.dylib,
file is not of required architecture
ld warning: in /usr/local/mysql-5.1.40-osx10.5-x86/lib/libmygcc.a, file is not
of required architecture
Try using MacPorts:
http://www.macports.org/
Then:
sudo port install py26-mysql
There is definitely an architectural mismatch going on, though. Nothing really
I can do about that. If you are using a 64-bit Python, you need 64-bit MySQL,
and that's all there is to it.
Oh, and if you wanna know ahead of time which architecture is which, use this
command:
file /Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6
(depends on where you have python installed, of course)
OK... that doesn't help me. I have the same problem. It's not a 32/64 bit
issue. Tried the macports approach, made no difference for me. This is on
10.5.8 as well.
/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6: Mach-O
universal binary with 2 architectures
/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6 (for
architecture ppc): Mach-O executable ppc
/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6 (for
architecture i386): Mach-O executable i386
/usr/local/mysql/bin/mysqld: Mach-O executable i386
Python 2.6.2 (r262:71600, Apr 16 2009, 09:17:39)
on darwin
Type "help", "copyright", "credits" or "license" for more information.
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-
packages/MySQL_python-1.2.3c1-py2.6-macosx-10.3-fat.egg/_mysql.py:3:
UserWarning: Module _mysql was already imported from
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-
packages/MySQL_python-1.2.3c1-py2.6-macosx-10.3-fat.egg/_mysql.pyc,
but /Users/jstoner/Downloads/MySQL-python-1.2.3c1 is being added to sys.path
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "MySQLdb/init.py", line 19, in <module>
import _mysql
File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 7, in <module>
File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 6, in bootstrap
ImportError: dynamic module does not define init function (init_mysql)
any ideas?
aack--on review, maybe its not the same issue. But macports didn't help,
anyway.