On Mon, Aug 31, 2009 at 8:02 AM, Stuart
Thiessen<thiesse...@gmail.com> wrote:
>
> I am compiling a wxPython program that I have been working on. It
> works fine from the command line, but when I use py2app, it is
> complaining that it cannot find one of my modules that goes with my
> application. My py2app setup script looks like this:
>
> """
> This is a setup.py script generated by py2applet
>
> Usage:
> python setup.py py2app
> """
>
> from setuptools import setup
>
> APP = ['ge2c.py']
> DATA_FILES = ['resources/','ge2c/']
> OPTIONS = {'argv_emulation': True, 'iconfile':'resources/
> e2c_icon.icns', 'resources': ['resources/e2c_icon.icns', 'resources/
> ELAN2CONNOT.css'],
> 'packages': ('wx', 'ge2c'), 'site_packages': True, 'plist' :
> {'CFBundleName': 'ELAN2CONNOT', 'CFBundleShortVersionString': '0.7.2',
> 'CFBundleGetInfoString': 'ELAN2CONNOT 0.7.2',
> 'CFBUNDLEExecutable': 'ELAN2CONNOT', 'CFBundleIndentifier':
> 'com.doorinternational.ge2c'}}
Here are a few things too look at
1) You probably do not need the 'packages' and 'site_packages'
arguments (I have never used them in any of my projects anyway).
2) If your doing dynamic imports you may need to specify some explicit includes
i.e)
options = {'py2app' : {'includes' : ['ge2c.*',], ...}
3) If your package is not directly on the path of your setup file you
may need to modify sys.path before running setup() to help if find
your modules.
Cody
> I did some modifications like you suggest, but no luck. Running it
> from the commandline works fine.
>
> The structure of my source directory is as follows:
>
> ./ge2c.0.7.2
>
> ge2c/
> __init__.py
> panels.py
> export.py
> dialogs.py
> document.py
> rtfwriter.py
> ge2c.py
> setup.py (for py2app)
> setup_win32.py (for py2exe)
>
> In ge2c.py, i just call import ge2c. The __init__.py imports all of
> the modules. Within ge2c package, I just import the specific module.
> The error occurs within the ge2c.py file.
>
> Other thoughts?
Try changing the name of your main module to be different than the
package name.
--
Robin Dunn
Software Craftsman
http://wxPython.org
> Other thoughts?
Do take a look at the output py2app provides when building. Also, py2app
puts all teh python packages it includ3ed in:
YourAppName.app/Contents/Resources/lib/python2.5/site-packages.zip
you can unzip that, and see what's there -- it may give you a hint as to
what's going on.
-Chris
--
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
Thanks! That did the trick!