I had issues as well. I found that this setup.py works for me. I also had to import the PyGUI modules specially in my main script as follows:<div><br></div><div><div>from GUI.Buttons import Button</div><div>from GUI.RadioGroups import RadioGroup</div>
<div>from GUI.RadioButtons import RadioButton</div><div>from GUI.Labels import Label</div><div>from GUI.CheckBoxes import CheckBox</div><div>from GUI.Frames import Frame</div><div>from GUI.Applications import Application</div>
<div>from GUI.Menus import Menu</div><div>from GUI.MenuLists import MenuList</div><div>from GUI.Windows import Window</div><div>from GUI.Sliders import Slider</div><div>from GUI.Colors import rgb</div><div>from GUI.Resources import resource_path, find_resource</div>
<div>from GUI.FileDialogs import request_old_file</div><div>from GUI.Files import FileRef, FileType, DirRef</div></div><div><br></div><div>Here are the contents of my setup.py file:</div><div><br></div><div><div># Build an executable for my_script.</div>
<div>#</div><div>import sys</div><div>import os</div><div><br></div><div># Yet another *hack* to get py2exe to work. It can't seem to find</div><div># win32com.shell.</div><div><br></div><div># ModuleFinder can't handle runtime changes to __path__, but win32com uses them</div>
<div>try:</div><div> # py2exe 0.6.4 introduced a replacement modulefinder.</div><div> # This means we have to add package paths there, not to the built-in</div><div> # one. If this new modulefinder gets integrated into Python, then</div>
<div> # we might be able to revert this some day.</div><div> # if this doesn't work, try import modulefinder</div><div> try:</div><div> import py2exe.mf as modulefinder</div><div> except ImportError:</div>
<div> import modulefinder</div><div> import win32com</div><div> for p in win32com.__path__[1:]:</div><div> modulefinder.AddPackagePath("win32com", p)</div><div> for extra in ["win32com.shell"]: #,"win32com.mapi"</div>
<div> __import__(extra)</div><div> m = sys.modules[extra]</div><div> for p in m.__path__[1:]:</div><div> modulefinder.AddPackagePath(extra, p)</div><div>except ImportError:</div><div> # no build path setup, no worries.</div>
<div> pass</div><div><br></div><div>from distutils.core import setup</div><div>import py2exe</div><div><br></div><div>origIsSystemDLL = py2exe.build_exe.isSystemDLL</div><div>def isSystemDLL(pathname):</div><div> if os.path.basename(pathname).lower() in ("msvcp71.dll", "dwmapi.dll", "mfc71.dll"):</div>
<div> return 0</div><div> return origIsSystemDLL(pathname)</div><div>py2exe.build_exe.isSystemDLL = isSystemDLL</div><div><br></div><div>################################################################</div>
<div><br></div><div># If run without args, build executables, in quiet mode.</div><div>if len(sys.argv) == 1:</div><div> sys.argv.append("py2exe")</div><div> sys.argv.append("-q")</div><div><br>
</div>
<div>class Target:</div><div> def __init__(self, **kw):</div><div> self.__dict__.update(kw)</div><div> # for the versioninfo resources</div><div> self.version = "1.0.0"</div><div> self.company_name = "My Company"</div>
<div> self.copyright = "Copyright 2011 Me. All rights reserved."</div><div> <a href="http://self.name">self.name</a> = "My Script"</div><div><br></div><div><br></div><div>my_script = Target(</div>
<div> # used for the versioninfo resource</div><div> description = "A cool description",</div><div><br></div><div> # what to build</div><div> script = "my_script.py",</div><div> dest_base = "my_script")</div>
<div><br></div><div><br></div><div>setup(</div><div> options = {"py2exe": {"compressed": 1,</div><div> "optimize": 2,</div><div> "ascii": 1,</div>
<div> "bundle_files": 3,</div><div> "packages" : ['GUI', 'encodings'],</div><div> }},</div><div> zipfile = None,</div><div>
windows = [my_script]</div>
<div> )</div></div><div><br></div><div><br></div><div>I hope this helps.</div><div><br>Regards,</div><div>Mark.</div><div><br><div class="gmail_quote">On Thu, Apr 14, 2011 at 6:46 PM, Devon Meunier <span dir="ltr"><<a href="mailto:devon.meunier@gmail.com">devon.meunier@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I have similar issues with py2exe.<br>
<div><div></div><div class="h5"><br>
On Thu, Apr 14, 2011 at 5:59 PM, Vernon Cole <<a href="mailto:vernondcole@gmail.com">vernondcole@gmail.com</a>> wrote:<br>
> Try <a href="http://www.py2exe.org/" target="_blank">http://www.py2exe.org/</a><br>
> If that does not work, get back to us on this list.<br>
> Vernon Cole<br>
><br>
> On Thu, Apr 14, 2011 at 1:59 PM, Devon Meunier <<a href="mailto:devon.meunier@gmail.com">devon.meunier@gmail.com</a>><br>
> wrote:<br>
>><br>
>> Hello all,<br>
>><br>
>> I've written a simple application in PyGUI, and I'm wondering how best<br>
>> to distribute this to Windows users who do not have Python, Pywin32,<br>
>> or PyGUI installed. Normally, I would use cx_freeze to produce an<br>
>> .exe, but it appears to be unable to load PyGUI. Thoughts? Options?<br>
>><br>
>> Thanks,<br>
>><br>
>> Devon<br>
>> _______________________________________________<br>
>> Pygui mailing list<br>
>> <a href="mailto:Pygui@python.org">Pygui@python.org</a><br>
>> <a href="http://mail.python.org/mailman/listinfo/pygui" target="_blank">http://mail.python.org/mailman/listinfo/pygui</a><br>
><br>
><br>
_______________________________________________<br>
Pygui mailing list<br>
<a href="mailto:Pygui@python.org">Pygui@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/pygui" target="_blank">http://mail.python.org/mailman/listinfo/pygui</a><br>
</div></div></blockquote></div><br></div>