[Pythonmac-SIG] Install MySQLdb module on mac os x

Dieter Gyselinck dietergyselinck@pandora.be
Mon, 18 Nov 2002 13:14:30 +0100


Hi,

     I'm trying to install the python MySQLdb module on os x 10.2 but 
when I try to run 'setup.py build' I get this error message :
ld: can't locate file for: -lmysqlclient
error: command 'gcc' failed with exit status 1

I have installed binary mysql-3.23.52 package and it seems to be 
working fine, I can access my db via php.  I am trying to run the 
MySQL-python-0.9.2 setup.  I have changed 'thread_safe_library' to 'NO' 
but that does not solve the problem.  Anyone can help me out with this 
problem???

This is the output when I run setup.py build :
running build
running build_py
not copying CompatMysqldb.py (output up-to-date)
not copying _mysql_exceptions.py (output up-to-date)
not copying MySQLdb/__init__.py (output up-to-date)
not copying MySQLdb/converters.py (output up-to-date)
not copying MySQLdb/connections.py (output up-to-date)
not copying MySQLdb/cursors.py (output up-to-date)
not copying MySQLdb/sets.py (output up-to-date)
not copying MySQLdb/times.py (output up-to-date)
not copying MySQLdb/constants/__init__.py (output up-to-date)
not copying MySQLdb/constants/CR.py (output up-to-date)
not copying MySQLdb/constants/FIELD_TYPE.py (output up-to-date)
not copying MySQLdb/constants/ER.py (output up-to-date)
not copying MySQLdb/constants/FLAG.py (output up-to-date)
not copying MySQLdb/constants/REFRESH.py (output up-to-date)
not copying MySQLdb/constants/CLIENT.py (output up-to-date)
running build_ext
building '_mysql' extension
skipping _mysql.c (build/temp.darwin-6.0-Power Macintosh-2.2/_mysql.o 
up-to-date)
gcc -arch i386 -arch ppc -bundle -flat_namespace -undefined suppress 
build/temp.darwin-6.0-Power Macintosh-2.2/_mysql.o -L/usr/lib/mysql 
-L/usr/local/lib/mysql -L/usr/local/mysql/lib/mysql -L/sw/lib 
-lmysqlclient -lz -o build/lib.darwin-6.0-Power Macintosh-2.2/_mysql.so 
-flat_namespace
ld: for architecture i386
ld: warning -L: directory name (/usr/lib/mysql) does not exist
ld: warning -L: directory name (/sw/lib) does not exist
ld: warning /usr/lib/bundle1.o cputype (18, architecture ppc) does not 
match cputype (7) for specified -arch flag: i386 (file not loaded)
ld: warning build/temp.darwin-6.0-Power Macintosh-2.2/_mysql.o cputype 
(18, architecture ppc) does not match cputype (7) for specified -arch 
flag: i386 (file not loaded)
ld: can't locate file for: -lmysqlclient
error: command 'gcc' failed with exit status 1

Thanx,
Dieter