My setup.py now looks like...

from setuptools import setup

APP = ['mac_test.py']
DATA_FILES = []
PACKAGES = ['MySQLdb']
INCLUDES = ['MySQLdb']
OPTIONS = {'argv_emulation': True,
          'packages': PACKAGES,
          'includes': INCLUDES,
          }

setup(
    app=APP,
    data_files=DATA_FILES,
    options={'py2app': OPTIONS},
    setup_requires=['py2app'],
    options=dict(py2app=dict(argv_emulation=True),
    )
)

I've tried it with only the PACKAGES, and only the INCLUDES, none of these
have worked.
MySQLdb is installed  in /Library/Python/2.5/site-packages.
mac_test.py includes  'import MySQLdb' at the top

when I run "python setup.py py2app -A" the executable is created, I attempt
to open it and receive
ImportError: No Module named MySQLdb
when I run "python setup.pu py2app" the executable is created and opening it
receives...
ImportError:
'/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/_mysql.so'

On Mon, Apr 27, 2009 at 11:39, Christopher Barker <chris.bar...@noaa.gov>wrote:

> Elizabeth Lackey wrote:
>
>  I cannot figure out the syntax to edit the setup.py file created by
>> py2applet to allow for the MySQLdb module.
>>
>
> there are a couple ways to pass options in, so it doe3s get hard to figure
> out:
>
>  from setuptools import setup
>>
>> APP = ['mac_test.py']
>> DATA_FILES = []
>>
>
> PACKAGES = ['A_Package',
>            'Another_Package',
>            ]
>
> INCLUDES = ['A_Module',
>            'Another_Module',
>           ]
>
> EXCLUDES = ['A_module_you_don't_want',
>           ]
>
> OPTIONS = {'argv_emulation': True,
>           'packages': PACKAGES,
>           'includes': INCLUDES,
>           'excludes': EXCLUDES,
>           }
>
>
> 'packages' includes the entire package -- including all data, etc.
> 'includes' only includes module, but it's a bit buggy if the module is
> inside a package hierarchy. For instance, if you have:
>
> import packageA.packageB.moduleA
>
> and you include 'packageA.PackageB.moduleA' in py2app, module A will get
> put in the bundle, but at the top level, so it would have to be imported by:
> 'import moduleA'
>
> you can work around that by either adding all of packageA, or, specifically
> including the whole chain:
>
> INCLUDES = ['packageA',
>            'packageA.packageB'
>            'packageA.packageB.moduleA'
>           ]
>
>
>  setup(
>>    app=APP,
>>    data_files=DATA_FILES,
>>    options={'py2app': OPTIONS},
>>    setup_requires=['py2app'],
>>    options=dict(py2app=dict(argv_emulation=True),
>>    )
>> )
>>
>> I assume I need to add something along the lines of this, but I can't
>> figure out the syntax
>> options=dict(includes=['MySQLdb'])
>>
>> Please help!
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
>> http://mail.python.org/mailman/listinfo/pythonmac-sig
>>
>
>
> --
> Christopher Barker, Ph.D.
> Oceanographer
>
> Emergency Response Division
> NOAA/NOS/OR&R            (206) 526-6959   voice
> 7600 Sand Point Way NE   (206) 526-6329   fax
> Seattle, WA  98115       (206) 526-6317   main reception
>
> chris.bar...@noaa.gov
>
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

Reply via email to