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'}}
setup(
app=APP,
data_files=DATA_FILES,
options={'py2app': OPTIONS},
setup_requires=['py2app'],
)
The error I receive when I run the app file it creates is this:
8/31/09 01:09:02 [0x0-0x5cf5cf].org.pythonmac.unspecified.ELAN2CONNOT
[19393] Traceback (most recent call last):
8/31/09 01:09:02 [0x0-0x5cf5cf].org.pythonmac.unspecified.ELAN2CONNOT
[19393] File "/Users/user/Documents/DOOR/Consultant Work/Elan2CONNOT/
GUI/ge2c-0.7.2/dist/ELAN2CONNOT.app/Contents/Resources/__boot__.py",
line 156, in <module>
8/31/09 01:09:02 [0x0-0x5cf5cf].org.pythonmac.unspecified.ELAN2CONNOT
[19393] _run('ge2c.py')
8/31/09 01:09:02 [0x0-0x5cf5cf].org.pythonmac.unspecified.ELAN2CONNOT
[19393] File "/Users/user/Documents/DOOR/Consultant Work/Elan2CONNOT/
GUI/ge2c-0.7.2/dist/ELAN2CONNOT.app/Contents/Resources/__boot__.py",
line 153, in _run
8/31/09 01:09:02 [0x0-0x5cf5cf].org.pythonmac.unspecified.ELAN2CONNOT
[19393] execfile(path, globals(), globals())
8/31/09 01:09:02 [0x0-0x5cf5cf].org.pythonmac.unspecified.ELAN2CONNOT
[19393] File "/Users/user/Documents/DOOR/Consultant Work/Elan2CONNOT/
GUI/ge2c-0.7.2/dist/ELAN2CONNOT.app/Contents/Resources/ge2c.py", line
26, in <module>
8/31/09 01:09:02 [0x0-0x5cf5cf].org.pythonmac.unspecified.ELAN2CONNOT
[19393] from ge2c import *
8/31/09 01:09:02 [0x0-0x5cf5cf].org.pythonmac.unspecified.ELAN2CONNOT
[19393] File "/Users/user/Documents/DOOR/Consultant Work/Elan2CONNOT/
GUI/ge2c-0.7.2/dist/ELAN2CONNOT.app/Contents/Resources/ge2c.py", line
349, in <module>
8/31/09 01:09:02 [0x0-0x5cf5cf].org.pythonmac.unspecified.ELAN2CONNOT
[19393] app = ThisApp(0)
8/31/09 01:09:02 [0x0-0x5cf5cf].org.pythonmac.unspecified.ELAN2CONNOT
[19393] File "/BinaryCache/wxWidgets/wxWidgets-11~88/Root/System/
Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/
wx-2.8-mac-unicode/wx/_core.py", line 7757, in __init__
8/31/09 01:09:02 [0x0-0x5cf5cf].org.pythonmac.unspecified.ELAN2CONNOT
[19393] File "/BinaryCache/wxWidgets/wxWidgets-11~88/Root/System/
Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/
wx-2.8-mac-unicode/wx/_core.py", line 7354, in _BootstrapApp
8/31/09 01:09:02 [0x0-0x5cf5cf].org.pythonmac.unspecified.ELAN2CONNOT
[19393] File "/Users/user/Documents/DOOR/Consultant Work/Elan2CONNOT/
GUI/ge2c-0.7.2/dist/ELAN2CONNOT.app/Contents/Resources/ge2c.py", line
332, in OnInit
8/31/09 01:09:02 [0x0-0x5cf5cf].org.pythonmac.unspecified.ELAN2CONNOT
[19393] self.frame = MainFrame(None, -1, "GE2C")
8/31/09 01:09:02 [0x0-0x5cf5cf].org.pythonmac.unspecified.ELAN2CONNOT
[19393] File "/Users/user/Documents/DOOR/Consultant Work/Elan2CONNOT/
GUI/ge2c-0.7.2/dist/ELAN2CONNOT.app/Contents/Resources/ge2c.py", line
81, in __init__
8/31/09 01:09:02 [0x0-0x5cf5cf].org.pythonmac.unspecified.ELAN2CONNOT
[19393] self.panel_l = panels.ParameterPanel(self) # fields for
data
8/31/09 01:09:02 [0x0-0x5cf5cf].org.pythonmac.unspecified.ELAN2CONNOT
[19393] NameError: global name 'panels' is not defined
8/31/09 01:09:05 com.apple.launchd[108]
([0x0-0x5cf5cf].org.pythonmac.unspecified.ELAN2CONNOT[19393]) Exited
with exit code: 255
In my source folder, all of my modules for this application are under
a folder called ge2c which has dialogs.py, document.py, export.py,
panels.py, rtfwriter.py. The main script then calls whatever it needs
from those modules. I do have an __init__.py in the ge2c folder which
contains: __all__ = ["document", "panels", "export", "dialogs",
"rtfwriter"]
Any thoughts?
Thanks,
Stuart