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

Jack Jansen Jack.Jansen@oratrix.com
Mon, 18 Nov 2002 14:52:08 +0100


On maandag, nov 18, 2002, at 13:14 Europe/Amsterdam, Dieter Gyselinck 
wrote:

> 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
> 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

This probably isn't the problem, but you should fix it anyway: Apple 
distributes a /usr/lib/python2.2/config/Makefile that isn't 100% 
correct. Edit it (with sudo) and remove the "-arch i386".

> ld: warning -L: directory name (/usr/lib/mysql) does not exist
> ld: warning -L: directory name (/sw/lib) does not exist

This is the problem, I think: the build procedure doesn't know where 
your mysql library is located. You can probably edit the setup.py file 
to tell it where it is.
--
- Jack Jansen        <Jack.Jansen@oratrix.com>        
http://www.cwi.nl/~jack -
- If I can't dance I don't want to be part of your revolution -- Emma 
Goldman -