Running MySQLdb under solaris and python 2.1

Martin von Loewis loewis at informatik.hu-berlin.de
Fri Dec 28 18:26:47 EST 2001


beyer at incent.com (hugh) writes:

> ImportError: ld.so.1: python: fatal: libmysqlclient.so.10: open
> failed: No such file or directory
> >>>
> 
> So it's finding the MySQLdb package; it's loading the _mysql.so
> module; and then it's failing to link in the libmysqlclient. (right?)
> I've found libmysqlclient but I can't get it into the right directory
> so the system can link it in--usr/local/bin (where the python program
> is), usr/local/lib and usr/local/lib/python2.1 all don't work.
> 
> Is there some magic place for it? 

The system only looks in /lib and /usr/lib, see ld.so(1). You can
hard-code additional directories to search for libraries inside
_mysql.so, by passing a -R option to the linker, e.g.

cc -G -o _mysql.so <object files> -R/myhome/lib -L/myhome/lib -lmysqlclient

See ld(1) for a description of the -R option.

> Is there some environment variable I can set so it can be found?

Yes, LD_LIBRARY_PATH, see ld.so(1).

HTH,
Martin



More information about the Python-list mailing list