crash without error report on Win7

45 views
Skip to first unread message

matt wilkie

unread,
Oct 17, 2011, 3:53:06 PM10/17/11
to PyInstaller
Hello,

Every so many months I grab the newest version of pyinstaller from svn
and run it on an application I'd like to make portable to see if it
"just works". So far it hasn't, and there are usually a bunch of error
messages in the standard python traceback style that indicate what it
stopped on this time. Today however there are no errors at all, just
the windows error dialog "... has stopped working", and "do you want
to send more information [to microsoft]?"

The application is the Leo Editor http://webpages.charter.net/edreamleo/front.html,
updated from bzr this morning (r4602, https://code.launchpad.net/~leo-editor-team/leo-editor/trunk).
It relies on PyQt4. Pyinstaller is svn r1693, exported to a new
directory. Python is 2.7, 32 bit.

I built the exe by, open command shell with py2.7 active and:
{{{
Path=C:\o4w_py27\bin;C:\Windows\system32;C:\Windows;C:\Windows
\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows
\sysWOW64;c:\local\bin;b:\bin
PYTHONHOME=C:\o4w_py27\apps\Python27

pyinstaller.bat --onedir b:\apps\leo-editor\launchLeo.py
}}}

The resulting application is started from a command shell stripped of
any PYTHON environment variables. PATH is deleted completely to
sidestep the possibility of some dll or other from another directory
interfering.

I'm not a developer, just some guy trying to hack my way through stuff
and is occasionally successful. Is there something I can do, given
that my python skills are anemic, to try and determine what is
breaking?

thanks,

-matt

matt wilkie

unread,
Oct 17, 2011, 4:05:18 PM10/17/11
to PyInstaller
> stopped on this time. Today however there are no errors at all, just
> the windows error dialog "... has stopped working", and "do you want
> to send more information [to microsoft]?"

I rediscovered the note that UPX is incompatible with pyqt4. Using the
`--noupx` parameter yields an exe that doesn't spawn the windows crash
dialog. Still doesn't work, though now I have a loose thread to pull
on to try and untangle why ;-)

{{{
d:\temp\pyinstaller>launchLeo\dist\launchLeo\launchLeo.exe
*** isPython3: False
Traceback (most recent call last):
File "<string>", line 8, in <module>
File "D:\temp\pyinstaller\launchLeo\build\pyi.win32\launchLeo
\outPYZ1.pyz\leo.
core.runLeo", line 120, in run
File "D:\temp\pyinstaller\launchLeo\build\pyi.win32\launchLeo
\outPYZ1.pyz\leo.
core.runLeo", line 472, in doPostPluginsInit
File "D:\temp\pyinstaller\launchLeo\build\pyi.win32\launchLeo
\outPYZ1.pyz\leo.
core.runLeo", line 524, in createFrame
File "D:\temp\pyinstaller\launchLeo\build\pyi.win32\launchLeo
\outPYZ1.pyz\leo.
core.leoGlobals", line 2237, in openWithFileName
File "D:\temp\pyinstaller\launchLeo\build\pyi.win32\launchLeo
\outPYZ1.pyz\leo.
core.leoGlobals", line 2372, in openWrapperLeoFile
File "D:\temp\pyinstaller\launchLeo\build\pyi.win32\launchLeo
\outPYZ1.pyz\leo.
core.leoApp", line 612, in newLeoCommanderAndFrame
File "D:\temp\pyinstaller\launchLeo\build\pyi.win32\launchLeo
\outPYZ1.pyz\leo.
plugins.qtGui", line 4203, in finishCreate
File "D:\temp\pyinstaller\launchLeo\build\pyi.win32\launchLeo
\outPYZ1.pyz\leo.
plugins.qtGui", line 7349, in createFrame
File "D:\temp\pyinstaller\launchLeo\build\pyi.win32\launchLeo
\outPYZ1.pyz\leo.
plugins.qtGui", line 2176, in construct
AssertionError
}}}

-matt

matt wilkie

unread,
Oct 17, 2011, 4:55:45 PM10/17/11
to PyInstaller
I found the warn*.txt file under the build directory. It is full of
lines of "W: no module named X"

{{{
W: no module named configparser (conditional import by
leo.plugins.mod_http)
W: no module named org (delayed import by xml.sax)
W: no module named _dummy_threading (top-level import by
dummy_threading)
}}}

.../pyinstaller/doc/Manual.html#buildtime-warnings indicates these are
likely harmless.

I tried ` --log-level=DEBUG` but there was no change in the error
messages. Any suggestions as to what I might try next?

thanks.

-matt

Martin Zibricky

unread,
Oct 17, 2011, 5:07:51 PM10/17/11
to pyins...@googlegroups.com
matt wilkie píše v Po 17. 10. 2011 v 13:55 -0700:

> I tried ` --log-level=DEBUG` but there was no change in the error
> messages. Any suggestions as to what I might try next?

--debug option

or

./utils/ArchiveViewer.py

With this tool you should be able look at your .exe created by
pyinstaller and ensure that it contains all necessary dependencies
required by your app.

matt wilkie

unread,
Oct 17, 2011, 5:29:46 PM10/17/11
to PyInstaller
Hi Martin, thanks for the response.

> > I tried ` --log-level=DEBUG` but there was no change in the error
> > messages. Any suggestions as to what I might try next?
>
> --debug option

?
.../pyinstaller/doc/Manual.html#getting-debug-messages says the format
is log-level=, which seems to be borne out by:

{{{
D:\temp\pyinstaller>py utils\Build.py --debug=1 launchLeo
\launchLeo.spec
Usage: Build.py [options] specfile

Build.py: error: no such option: --debug
}}}

-matt

Martin Zibricky

unread,
Oct 17, 2011, 5:37:01 PM10/17/11
to pyins...@googlegroups.com
matt wilkie píše v Po 17. 10. 2011 v 14:29 -0700:

> Build.py: error: no such option: --debug

The debug option is for pyinstaller.py script.


./pyinstaller.py --debug

debug option makes your app to print some debug information when
running.

matt wilkie

unread,
Oct 17, 2011, 5:44:58 PM10/17/11
to PyInstaller
> .../pyinstaller/doc/Manual.html#getting-debug-messages says the format
> is log-level= ...

oh, now I get it:

`--log-level=n` is an option to pass to pyinstaller or ./utils/
Build.py, while
`--debug` is an option which can be used on the packaged .exe

The docs aren't very clear on that, or at least not to me. In any case
using `myapp.exe --debug` didn't change the output at all other than
adding a single line `scanOptions: *** debug mode on` to the console
output.

I used ArchiveViewer.py and as best I can tell every "warning module
message" in build/warn*.txt has a corresponding entry in outPYZ1.pyz.
I think I'm just in over my head. :) Maybe the next time I try this
something will have changed, or I'll have learned enough, to get a
little farther.

cheers,

-matt

Martin Zibricky

unread,
Oct 17, 2011, 5:56:37 PM10/17/11
to pyins...@googlegroups.com
matt wilkie píše v Po 17. 10. 2011 v 14:44 -0700:

> `--debug` is an option which can be used on the packaged .exe

No, you have to use --debug when you create your exe by script
'pyinstaller.exe'

matt wilkie

unread,
Oct 17, 2011, 6:22:28 PM10/17/11
to PyInstaller
> > `--debug` is an option which can be used on the packaged .exe
>
> No, you have to use --debug when you create your exe by script
> 'pyinstaller.exe'

okay, now I'm really confused. I don't have a "pyinstaller.exe", only
"pyinstaller.py" and "pyinstaller-gui.py".

-matt

Martin Zibricky

unread,
Oct 17, 2011, 6:24:34 PM10/17/11
to pyins...@googlegroups.com
matt wilkie píše v Po 17. 10. 2011 v 15:22 -0700:

>
> okay, now I'm really confused. I don't have a "pyinstaller.exe", only
> "pyinstaller.py" and "pyinstaller-gui.py".

Sorry, I meant pyinstaller.py

Hartmut Goebel

unread,
Oct 18, 2011, 4:34:06 AM10/18/11
to pyins...@googlegroups.com
Am 17.10.2011 23:44, schrieb matt wilkie:
> `--log-level=n` is an option to pass to pyinstaller or ./utils/
> Build.py, while
> `--debug` is an option which can be used on the packaged .exe

I just updated the help messages to state this more clearly.

--
Schönen Gruß - Regards
Hartmut Goebel
Dipl.-Informatiker (univ.), CISSP, CSSLP

Goebel Consult
Spezialist für IT-Sicherheit in komplexen Umgebungen
http://www.goebel-consult.de

Monatliche Kolumne: http://www.cissp-gefluester.de/
Goebel Consult ist Mitglied bei http://www.7-it.de

matt wilkie

unread,
Nov 23, 2011, 6:18:13 PM11/23/11
to PyInstaller
> Every so many months I grab the newest version of pyinstaller from svn
> and run it on an application I'd like to make portable to see if it
> "just works". So far it hasn't, and there are usually a bunch of error
...

> The application is the Leo Editor
> http://webpages.charter.net/edreamleo/front.html

Okay, one month later and I'm taking another run at this, and have
made it a little farther through the swamp. I've svn up'd to current
pyinstaller.

my build command:

{{{
pyinstaller --out=..\_builds --onedir --noupx ^
--icon=b:\appsleo-editor\leo\Icons\LeoApp.ico ^
--log-level=DEBUG ^
b:\apps\leo-editor\launchLeo.py
}}}

And then when I run the output exe:

{{{
B:\code\_builds\dist>launchLeo\launchLeo.exe --debug
_MEIPASS2 is NULL
Extracting binaries
Executing self as child with Setting up to run child
Creating child process
Waiting for child process to finish...
_MEIPASS2 is B:\code\_builds\dist\launchLeo\
Already in the child - running!
manifestpath: B:\code\_builds\dist\launchLeo\launchLeo.exe.manifest
Activation context created
Activation context activated
B:\code\_builds\dist\launchLeo\python27.dll
Manipulating evironment
PYTHONPATH=B:/code/_builds/dist/launchLeo
importing modules from CArchive
extracted iu
extracted struct
extracted archive
Installing import hooks
outPYZ1.pyz
Running scripts


scanOptions: *** debug mode on

Traceback (most recent call last):
File "<string>", line 8, in <module>

File "..\_builds\build\pyi.win32\launchLeo\outPYZ1.pyz
\leo.core.runLeo", line
120, in run
File "..\_builds\build\pyi.win32\launchLeo\outPYZ1.pyz
\leo.core.runLeo", line
474, in doPostPluginsInit
File "..\_builds\build\pyi.win32\launchLeo\outPYZ1.pyz
\leo.core.runLeo", line
526, in createFrame
File "..\_builds\build\pyi.win32\launchLeo\outPYZ1.pyz
\leo.core.leoGlobals", l
ine 2262, in openWithFileName
File "..\_builds\build\pyi.win32\launchLeo\outPYZ1.pyz
\leo.core.leoGlobals", l
ine 2408, in openWrapperLeoFile
File "..\_builds\build\pyi.win32\launchLeo\outPYZ1.pyz
\leo.core.leoApp", line
623, in newLeoCommanderAndFrame
File "..\_builds\build\pyi.win32\launchLeo\outPYZ1.pyz
\leo.plugins.qtGui", lin
e 4043, in finishCreate
File "..\_builds\build\pyi.win32\launchLeo\outPYZ1.pyz
\leo.plugins.qtGui", lin
e 7200, in createFrame
File "..\_builds\build\pyi.win32\launchLeo\outPYZ1.pyz
\leo.plugins.qtGui", lin
e 2047, in construct
AssertionError
RC: -1 from launchLeo
OK.
Deactivating activation context
Releasing activation context
Done
Back to parent...
Freeing status for B:\code\_builds\dist\launchLeo\launchLeo.exe
}}}

And the corresponding code block in leo.plugins.gqtGui
(http://bazaar.launchpad.net/~leo-editor-team/leo-editor/trunk/view/
head:/leo/plugins/qtGui.py):

{{{
ui_description_file = g.app.loadDir + "/../plugins/" +
ui_file_name
# g.pr('DynamicWindw.__init__,ui_description_file)
assert g.os_path_exists(ui_description_file)
}}}

can you tell from this if there is something that needs to be changed
in the Leo code to make this work, or something added to the
pyinstaller .spec file?

thanks,

-matt

Martin Zibricky

unread,
Nov 23, 2011, 7:17:18 PM11/23/11
to pyins...@googlegroups.com
matt wilkie píše v St 23. 11. 2011 v 15:18 -0800:

> can you tell from this if there is something that needs to be changed
> in the Leo code to make this work, or something added to the
> pyinstaller .spec file?

http://bazaar.launchpad.net/~leo-editor-team/leo-editor/trunk/view/head:/leo/core/leoGlobals.py

line 250: path = g.__file__

module.__file__ does not work in pyinstaller.

You have to use sys.executable when running executable created by
pyinstaller.

if hasattr(sys, 'frozen'): # detects if running from the executable.

See doc for more details.

matt wilkie

unread,
Nov 24, 2011, 12:04:00 PM11/24/11
to PyInstaller
> module.__file__ does not work in pyinstaller.
>
> You have to use sys.executable when running executable created by
> pyinstaller.

oh, ok. Thanks Martin.

-matt

Reply all
Reply to author
Forward
0 new messages