* Hartmut Goebel (Tue, 03 May 2011 15:59:14 +0200)
> Am 03.05.2011 14:09, schrieb Thorsten Kampe:
> > When I run the PyInstaller created single file executable
> > (myscript.exe), I get the following error: "winsys.dialogs.x_dialogs:
> > (1813, 'LoadIcon', 'The specified resource type cannot be found in the
> > image file.')"
> This seams to be a problem of the winsys parts.
Digging a bit deeper I also came to believe that.
The relevant part of the traceback is:
Traceback (most recent call last):
[...]
File "[...]\outPYZ1.pyz/winsys.dialogs", line 180, in <module>
File "[...]\outPYZ1.pyz/winsys.dialogs", line 176, in _register_wndclass
File "[...]\outPYZ1.pyz/winsys.exc", line 55, in _wrapped
winsys.dialogs.x_dialogs: (1813, 'LoadIcon', 'The specified resource
type cannot be found in the image file.')
This seems to be the problematic function in winsys.dialogs:
def _register_wndclass ():
ur"""Register a simple window with default cursor, icon, etc.
"""
[...]
python_exe = wrapped (win32api.GetModuleHandle, None)
wc.hIcon = wrapped (win32gui.LoadIcon, python_exe, 1)
[...]
> > How can I start troubleshooting? Is there a way to skip the WinSys
> > import and winsys function in msgbox.py if called from the PyInstaller
> > executable myscript.exe?
>
> Change your snippet into:
>
> import sys
> if not sys.frozen:
> [...]
This didn't work because if running the pure Python script, I get
"AttributeError: 'module' object has no attribute 'frozen'". I changed
it to "if not os.getenv('_MEIPASS2'):" and this works.
Thorsten
--
You received this message because you are subscribed to the Google Groups
"PyInstaller" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pyinstaller?hl=en.