import MySQLdb on Mac OS X (Python 2.0)

Tony McDonald tony.mcdonald at ncl.ac.uk
Fri Apr 13 08:15:02 EDT 2001


In article <3AD23C80.62CCDB45 at cc.gatech.edu>, Richard Scott Glazerman 
<rsg at cc.gatech.edu> wrote:

> I've gotten Python 2.0 installed on my OS X box, along with MySQL. I've
> 
> run the installer for MySQLdb, but when I try to import, i get the 
> following
> 
> error:
> 
> >>> import MySQLdb
> dyld: python multiple definitions of symbol _strtol
> /usr/lib/libSystem.B.dylib(strtol.o) definition of _strtol
> /usr/local/lib/python2.0/site-packages/_mysql.so definition of _strtol
> 
> anybody have any ideas as to how to fix this??
> 
> Thanks for the help
> 
> --
> Rich Glazerman
> rsg at cc.gatech.edu
> "640K ought to be enough for anybody." - Bill Gates, 1981


Richard,
There was an interesting thread on this at 
http://forums.macnn.com/cgi-bin/Forum34/HTML/000284.html
(the answer is from bobDalgeish) ,and following the information I 
managed to get it to work in the end.

Essentially get rid of the strto.o entry (which has strtol in it) in 
libmysqlclient.a and ranlib it, ie

% sudo ar -dv libmysqlclient.a strto.o
% sudo ranlib libmysqlclient.a

Then recompile up MySQLdb and reinstall it (make sure you remove the old 
stuff first).

HTH
tone.



More information about the Python-list mailing list