MySQLdb build on Solaris 7

Jeff Bauer jbauer at rubic.com
Wed Feb 20 08:56:22 EST 2002


Asim Beg wrote:
> Here's an excerpt from setup.py
> 
> elif sys.platform == "sunos5": # Solaris 2.8 + gcc
>     include_dirs = ['/usr/local/mysql/include']
>     library_dirs = ['/usr/local/mysql/lib']
>     libraries = [mysqlclient, "z"]
>     runtime_library_dirs = ['/usr/local/lib:/usr/openwin/lib:/usr/dt/lib']
>     extra_compile_args = ["-fPIC"]

Looks reasonable.  You've checked that the above directories
actually have mysql include files and libraries present, right?

Here's mine:

  elif sys.platform == "sunos5": # Solaris 2.8 
      include_dirs = ['/usr/local/include/mysql'] 
      library_dirs = ['/usr/local/lib/mysql'] 
      libraries = [mysqlclient, "z"] 
      runtime_library_dirs =
['/usr/local/lib:/usr/openwin/lib:/usr/dt/lib'] 
      extra_objects = [] 

And:

  LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib/mysql

Also, in your situation, your administrator may not permit you
to install files in /usr/local/lib/python2.1/site-packages/ --
though there isn't any real reason she shouldn't -- and it would
make it more convenient for running cgi scripts.  But assuming
she doesn't, you'll need those files (in the particular
relative path structure I mentioned in my earlier post) to 
be present in your importable path, e.g. PYTHONPATH or
(ugh) manually appended to sys.path.

I have worked with ISP admins whom I was able to convince
that installation into /site-packages/ was a good thing to
do for packages such as the MySQL interface; it would not
compromise security or maintenance and benefit other
Python users on their system.

Good luck.

Jeff Bauer
Rubicon Research




More information about the Python-list mailing list