#51 MacOSX - setup.py is bogus

MySQLdb-0.9.2
closed
Andy Dustman
MySQLdb (285)
5
2012-09-19
2003-03-05
Anonymous
No

I'm sure everyone is thrilled by the plethora of unique
ways you can install and use python on MacOSX. (Apple's
built-in, Fink pkg manager, various ZOPE binaries,
source, etc)

Unfortunately, this leads to much confusion for the
makefiles.

In my case...
I am using Fink for OS10.2x's version of ZOPE
and therefore need to use its matching 'fink installed
python' as opposed to Apple's.

Below is the Post I made to the Fink Developer's
Mailinglist detailing how I was able to configure
setup.py to work with Fink installed Zope (and python).


Ok, I figured it out.

I'm not using any binaries, fink installed everything
(mySQL, Zope and python 2.1)

When I commanded 'python setup.py build' it tried to
use Apple's Python
and I get the weird i386 problem.(Macs aren't i386)

When I commanded '/sw/bin/python2.1 setup.py build' it
uses the python from Fink. I don't get the -i386 problem.

HOWEVER,
the default setup.py in MySQL-python-0.9.2.tgz
which I downloaded from it's official home at
http://sourceforge.net/projects/mysql-python
DOES NOT WORK!

To get MySQL-python-0.9.2.tgz to build and install
correctly I had to make the following changes to
setup.py and then remember to use /sw/bin/python2.1 for
build and install.


>>>>scroll down to the line
mysqlclient = thread_safe_library and
"mysqlclient_r" or "mysqlclient"
>>>>remove the words "mysqlclient_r" or

>>>>scroll down to the section
elif sys.platform[:6] == "darwin": # Mac OS X
include_dirs.append('/sw/include')
library_dirs.append('/sw/lib')
extra_link_args.append('-flat_namespace')

>>>>Change it to replace the previous definitions
elif sys.platform[:6] == "darwin": # Mac OS X
include_dirs = ['/sw/include/mysql']
library_dirs = ['/sw/lib/mysql']
extra_link_args.append('-flat_namespace')

Discussion

  • Andy Dustman
    Andy Dustman
    2003-04-21

    Logged In: YES
    user_id=71372

    Try this:

    elif sys.platform[:6] == "darwin": # Mac OS X
    include_dirs.extend(['/sw/include', '/sw/include/mysql'])
    library_dirs.extend(['/sw/lib', '/sw/lib/mysql'])
    extra_link_args.append('-flat_namespace')

    Does that work OK? mysqlclient issue should be fixed in CVS.

     
  • Andy Dustman
    Andy Dustman
    2003-07-07

    Logged In: YES
    user_id=71372

    New setup.py should fix at least some of this

     
  • Andy Dustman
    Andy Dustman
    2003-07-07

    Logged In: YES
    user_id=71372

    This has been fixed in the current CVS tree.