Skip to content

Instantly share code, notes, and snippets.

@dalejfer
Last active January 27, 2018 20:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dalejfer/e61d80b05b0ae3163dac933c30041813 to your computer and use it in GitHub Desktop.
Save dalejfer/e61d80b05b0ae3163dac933c30041813 to your computer and use it in GitHub Desktop.
Pyinstaller bug
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
class ButtonWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="Button Demo")
self.set_border_width(10)
hbox = Gtk.Box(spacing=6)
self.add(hbox)
button = Gtk.Button.new_with_label("Click Me")
button.connect("clicked", self.on_click_me_clicked)
hbox.pack_start(button, True, True, 0)
button = Gtk.Button.new_with_mnemonic("_Open")
button.connect("clicked", self.on_open_clicked)
hbox.pack_start(button, True, True, 0)
button = Gtk.Button.new_with_mnemonic("_Close")
button.connect("clicked", self.on_close_clicked)
hbox.pack_start(button, True, True, 0)
def on_click_me_clicked(self, button):
print("\"Click me\" button was clicked")
def on_open_clicked(self, button):
print("\"Open\" button was clicked")
def on_close_clicked(self, button):
print("Closing application")
Gtk.main_quit()
print("before main class call")
win = ButtonWindow()
print("after main class call")
win.connect("delete-event", Gtk.main_quit)
win.show_all()
Gtk.main()
# -*- mode: python -*-
block_cipher = None
a = Analysis(['gui.py'],
pathex=['C:\\Users\\danie\\Documents\\dev\\testgui'],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name='gui',
debug=False,
strip=False,
upx=True,
console=True )
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
name='gui')
Transcript started, output file is .\output.txt
PS C:\Users\danie\Documents\dev\testgui> pyinstaller --log-level DEBUG .\gui.spec
20521 DEBUG: Erroneous edge (1230, None, <PyiModuleGraph>, 'encodings.ptcp154') for node SourceModul
e('encodings.ptcp154', 'c:\\python34\\lib\\encodings\\ptcp154.py').
20522 DEBUG: Erroneous edge (902, None, <PyiModuleGraph>, 'encodings.punycode') for node SourceModul
e('encodings.punycode', 'c:\\python34\\lib\\encodings\\punycode.py').
20522 DEBUG: Erroneous edge (1156, None, <PyiModuleGraph>, 'encodings.quopri_codec') for node Source
Module('encodings.quopri_codec', 'c:\\python34\\lib\\encodings\\quopri_codec.py').
20522 DEBUG: Erroneous edge (1316, None, <PyiModuleGraph>, 'encodings.raw_unicode_escape') for node
SourceModule('encodings.raw_unicode_escape', 'c:\\python34\\lib\\encodings\\raw_unicode_escape.py').
20523 DEBUG: Erroneous edge (1285, None, <PyiModuleGraph>, 'encodings.rot_13') for node SourceModule
('encodings.rot_13', 'c:\\python34\\lib\\encodings\\rot_13.py').
20523 DEBUG: Erroneous edge (1182, None, <PyiModuleGraph>, 'encodings.shift_jis') for node SourceMod
ule('encodings.shift_jis', 'c:\\python34\\lib\\encodings\\shift_jis.py').
20523 DEBUG: Erroneous edge (1209, None, <PyiModuleGraph>, 'encodings.shift_jis_2004') for node Sour
ceModule('encodings.shift_jis_2004', 'c:\\python34\\lib\\encodings\\shift_jis_2004.py').
20524 DEBUG: Erroneous edge (1169, None, <PyiModuleGraph>, 'encodings.shift_jisx0213') for node Sour
ceModule('encodings.shift_jisx0213', 'c:\\python34\\lib\\encodings\\shift_jisx0213.py').
20524 DEBUG: Erroneous edge (1006, None, <PyiModuleGraph>, 'encodings.tis_620') for node SourceModul
e('encodings.tis_620', 'c:\\python34\\lib\\encodings\\tis_620.py').
20526 DEBUG: Erroneous edge (1003, None, <PyiModuleGraph>, 'encodings.undefined') for node SourceMod
ule('encodings.undefined', 'c:\\python34\\lib\\encodings\\undefined.py').
20527 DEBUG: Erroneous edge (1275, None, <PyiModuleGraph>, 'encodings.unicode_escape') for node Sour
ceModule('encodings.unicode_escape', 'c:\\python34\\lib\\encodings\\unicode_escape.py').
20529 DEBUG: Erroneous edge (1103, None, <PyiModuleGraph>, 'encodings.unicode_internal') for node So
urceModule('encodings.unicode_internal', 'c:\\python34\\lib\\encodings\\unicode_internal.py').
20531 DEBUG: Erroneous edge (1010, None, <PyiModuleGraph>, 'encodings.utf_16') for node SourceModule
('encodings.utf_16', 'c:\\python34\\lib\\encodings\\utf_16.py').
20534 DEBUG: Erroneous edge (1131, None, <PyiModuleGraph>, 'encodings.utf_16_be') for node SourceMod
ule('encodings.utf_16_be', 'c:\\python34\\lib\\encodings\\utf_16_be.py').
20535 DEBUG: Erroneous edge (1039, None, <PyiModuleGraph>, 'encodings.utf_16_le') for node SourceMod
ule('encodings.utf_16_le', 'c:\\python34\\lib\\encodings\\utf_16_le.py').
20535 DEBUG: Erroneous edge (1093, None, <PyiModuleGraph>, 'encodings.utf_32') for node SourceModule
('encodings.utf_32', 'c:\\python34\\lib\\encodings\\utf_32.py').
20536 DEBUG: Erroneous edge (938, None, <PyiModuleGraph>, 'encodings.utf_32_be') for node SourceModu
le('encodings.utf_32_be', 'c:\\python34\\lib\\encodings\\utf_32_be.py').
20536 DEBUG: Erroneous edge (1281, None, <PyiModuleGraph>, 'encodings.utf_32_le') for node SourceMod
ule('encodings.utf_32_le', 'c:\\python34\\lib\\encodings\\utf_32_le.py').
20537 DEBUG: Erroneous edge (1288, None, <PyiModuleGraph>, 'encodings.utf_7') for node SourceModule(
'encodings.utf_7', 'c:\\python34\\lib\\encodings\\utf_7.py').
20537 DEBUG: Erroneous edge (957, None, <PyiModuleGraph>, 'encodings.utf_8') for node SourceModule('
encodings.utf_8', 'c:\\python34\\lib\\encodings\\utf_8.py').
20538 DEBUG: Erroneous edge (1099, None, <PyiModuleGraph>, 'encodings.utf_8_sig') for node SourceMod
ule('encodings.utf_8_sig', 'c:\\python34\\lib\\encodings\\utf_8_sig.py').
20538 DEBUG: Erroneous edge (1025, None, <PyiModuleGraph>, 'encodings.uu_codec') for node SourceModu
le('encodings.uu_codec', 'c:\\python34\\lib\\encodings\\uu_codec.py').
20538 DEBUG: Erroneous edge (1213, None, <PyiModuleGraph>, 'encodings.zlib_codec') for node SourceMo
dule('encodings.zlib_codec', 'c:\\python34\\lib\\encodings\\zlib_codec.py').
20540 DEBUG: Erroneous edge (1329, None, <PyiModuleGraph>, 'functools') for node SourceModule('funct
ools', 'c:\\python34\\lib\\functools.py').
20540 DEBUG: Erroneous edge (175, None, <PyiModuleGraph>, 'gc') for node BuiltinModule('gc',).
20564 DEBUG: Erroneous edge (873, None, <PyiModuleGraph>, 'heapq') for node SourceModule('heapq', 'c
:\\python34\\lib\\heapq.py').
20570 DEBUG: Erroneous edge (869, None, <PyiModuleGraph>, 'io') for node SourceModule('io', 'c:\\pyt
hon34\\lib\\io.py').
20571 DEBUG: Erroneous edge (1333, None, <PyiModuleGraph>, 'keyword') for node SourceModule('keyword
', 'c:\\python34\\lib\\keyword.py').
20572 DEBUG: Erroneous edge (1332, None, <PyiModuleGraph>, 'linecache') for node SourceModule('linec
ache', 'c:\\python34\\lib\\linecache.py').
20572 DEBUG: Erroneous edge (871, None, <PyiModuleGraph>, 'locale') for node SourceModule('locale',
'c:\\python34\\lib\\locale.py').
20574 DEBUG: Erroneous edge (51, None, <PyiModuleGraph>, 'ntpath') for node SourceModule('ntpath', '
c:\\python34\\lib\\ntpath.py').
20576 DEBUG: Erroneous edge (870, None, <PyiModuleGraph>, 'operator') for node SourceModule('operato
r', 'c:\\python34\\lib\\operator.py').
20584 DEBUG: Erroneous edge (26, None, <PyiModuleGraph>, 'posix') for node MissingModule('posix',).
20588 DEBUG: Erroneous edge (1331, None, <PyiModuleGraph>, 're') for node SourceModule('re', 'c:\\py
thon34\\lib\\re.py').
20588 DEBUG: Erroneous edge (1338, None, <PyiModuleGraph>, 'reprlib') for node SourceModule('reprlib
', 'c:\\python34\\lib\\reprlib.py').
20592 DEBUG: Erroneous edge (866, None, <PyiModuleGraph>, 'sre_compile') for node SourceModule('sre_
compile', 'c:\\python34\\lib\\sre_compile.py').
20596 DEBUG: Erroneous edge (1335, None, <PyiModuleGraph>, 'sre_constants') for node SourceModule('s
re_constants', 'c:\\python34\\lib\\sre_constants.py').
20596 DEBUG: Erroneous edge (1330, None, <PyiModuleGraph>, 'sre_parse') for node SourceModule('sre_p
arse', 'c:\\python34\\lib\\sre_parse.py').
20603 DEBUG: Erroneous edge (62, None, <PyiModuleGraph>, 'time') for node BuiltinModule('time',).
20604 DEBUG: Erroneous edge (1327, None, <PyiModuleGraph>, 'traceback') for node SourceModule('trace
back', 'c:\\python34\\lib\\traceback.py').
20605 DEBUG: Erroneous edge (868, None, <PyiModuleGraph>, 'types') for node SourceModule('types', 'c
:\\python34\\lib\\types.py').
20621 DEBUG: Erroneous edge (1326, None, <PyiModuleGraph>, 'weakref') for node SourceModule('weakref
', 'c:\\python34\\lib\\weakref.py').
20627 DEBUG: Erroneous edge (345, None, <PyiModuleGraph>, 'zipimport') for node BuiltinModule('zipim
port',).
20628 INFO: Graph cross-reference written to C:\Users\danie\Documents\dev\testgui\build\gui\xref-gui
.html
20699 INFO: Graph drawing written to C:\Users\danie\Documents\dev\testgui\build\gui\graph-gui.dot
21893 INFO: checking PYZ
21894 INFO: Building PYZ because out00-PYZ.toc is non existent
21895 INFO: Building PYZ (ZlibArchive) C:\Users\danie\Documents\dev\testgui\build\gui\out00-PYZ.pyz
23098 INFO: Building PYZ (ZlibArchive) C:\Users\danie\Documents\dev\testgui\build\gui\out00-PYZ.pyz
completed successfully.
23131 INFO: checking PKG
23131 INFO: Building PKG because out00-PKG.toc is non existent
23132 INFO: Building PKG (CArchive) out00-PKG.pkg
23147 DEBUG: Compiling c:\python34\lib\site-packages\PyInstaller\loader\pyiboot01_bootstrap.py
23148 DEBUG: Compiling c:\python34\lib\site-packages\PyInstaller\loader\pyiboot01_bootstrap.py
23151 DEBUG: Compiling c:\python34\lib\site-packages\PyInstaller\loader\rthooks\pyi_rth_gtk.py
23182 DEBUG: Compiling c:\python34\lib\site-packages\PyInstaller\loader\rthooks\pyi_rth_gtk.py
23187 DEBUG: Compiling c:\python34\lib\site-packages\PyInstaller\loader\rthooks\pyi_rth_glib.py
23198 DEBUG: Compiling c:\python34\lib\site-packages\PyInstaller\loader\rthooks\pyi_rth_glib.py
23216 DEBUG: Compiling c:\python34\lib\site-packages\PyInstaller\loader\rthooks\pyi_rth_gdkpixbuf.py
23217 DEBUG: Compiling c:\python34\lib\site-packages\PyInstaller\loader\rthooks\pyi_rth_gdkpixbuf.py
23218 DEBUG: Compiling c:\python34\lib\site-packages\PyInstaller\loader\rthooks\pyi_rth_gio.py
23219 DEBUG: Compiling c:\python34\lib\site-packages\PyInstaller\loader\rthooks\pyi_rth_gio.py
23220 DEBUG: Compiling c:\python34\lib\site-packages\PyInstaller\loader\rthooks\pyi_rth_gi.py
23224 DEBUG: Compiling c:\python34\lib\site-packages\PyInstaller\loader\rthooks\pyi_rth_gi.py
23226 DEBUG: Compiling C:\Users\danie\Documents\dev\testgui\gui.py
23230 DEBUG: Compiling C:\Users\danie\Documents\dev\testgui\gui.py
23253 INFO: Building PKG (CArchive) out00-PKG.pkg completed successfully.
23268 INFO: Bootloader c:\python34\lib\site-packages\PyInstaller\bootloader\Windows-64bit\run.exe
23269 INFO: checking EXE
23269 INFO: Building EXE because out00-EXE.toc is non existent
23269 INFO: Building EXE from out00-EXE.toc
23270 INFO: Appending archive to EXE C:\Users\danie\Documents\dev\testgui\build\gui\gui.exe
23415 INFO: Building EXE from out00-EXE.toc completed successfully.
23443 INFO: checking COLLECT
23444 INFO: Building COLLECT because out00-COLLECT.toc is non existent
23445 INFO: Building COLLECT out00-COLLECT.toc
61525 INFO: Building COLLECT out00-COLLECT.toc completed successfully.
PS C:\Users\danie\Documents\dev\testgui> Stop-Transcript
**********************
Windows PowerShell transcript end
End time: 20180127052825
**********************
PS> pyi-archive_viewer .\gui.exe
pos, length, uncompressed, iscompressed, type, name
[(0, 255, 329, 1, 'm', 'struct'),
(255, 1145, 1983, 1, 'm', 'pyimod01_os_path'),
(1400, 4403, 9968, 1, 'm', 'pyimod02_archive'),
(5803, 7422, 19564, 1, 'm', 'pyimod03_importers'),
(13225, 1937, 4560, 1, 's', 'pyiboot01_bootstrap'),
(15162, 276, 379, 1, 's', 'pyi_rth_gtk'),
(15438, 215, 250, 1, 's', 'pyi_rth_glib'),
(15653, 546, 760, 1, 's', 'pyi_rth_gdkpixbuf'),
(16199, 218, 256, 1, 's', 'pyi_rth_gio'),
(16417, 220, 256, 1, 's', 'pyi_rth_gi'),
(16637, 963, 1923, 1, 's', 'gui'),
(17600, 1235411, 1235411, 0, 'z', 'out00-PYZ.pyz')]
? O out00-PYZ.pyz
Name: (ispkg, pos, len)
{'__future__': (0, 17, 1860),
'_compat_pickle': (0, 1877, 3270),
'_dummy_thread': (0, 5147, 2215),
'_osx_support': (0, 7362, 5286),
'_strptime': (0, 12648, 7347),
'_threading_local': (0, 19995, 2942),
'argparse': (0, 22937, 24215),
'ast': (0, 47152, 5541),
'base64': (0, 52693, 7670),
'bdb': (0, 60363, 7794),
'bisect': (0, 68157, 878),
'bz2': (0, 69035, 6306),
'calendar': (0, 75341, 9637),
'cmd': (0, 84978, 6177),
'code': (0, 91155, 4248),
'codeop': (0, 95403, 2570),
'contextlib': (0, 97973, 4134),
'copy': (0, 102107, 3830),
'ctypes': (1, 105937, 7113),
'ctypes._endian': (0, 113050, 1082),
'ctypes.wintypes': (0, 114132, 2413),
'datetime': (0, 116545, 19454),
'difflib': (0, 135999, 22202),
'dis': (0, 158201, 6742),
'distutils': (1, 164943, 273),
'distutils.debug': (0, 165216, 144),
'distutils.errors': (0, 165360, 2006),
'distutils.log': (0, 167366, 1117),
'distutils.spawn': (0, 168483, 2862),
'distutils.sysconfig': (0, 171345, 6473),
'distutils.text_file': (0, 177818, 3921),
'doctest': (0, 181739, 28950),
'dummy_threading': (0, 210689, 629),
'email': (1, 211318, 684),
'email._encoded_words': (0, 212002, 3057),
'email._header_value_parser': (0, 215059, 28871),
'email._parseaddr': (0, 243930, 6109),
'email._policybase': (0, 250039, 5734),
'email.base64mime': (0, 255773, 1831),
'email.charset': (0, 257604, 4901),
'email.contentmanager': (0, 262505, 3833),
'email.encoders': (0, 266338, 836),
'email.errors': (0, 267174, 2056),
'email.feedparser': (0, 269230, 5383),
'email.generator': (0, 274613, 5926),
'email.header': (0, 280539, 7869),
'email.headerregistry': (0, 288408, 8344),
'email.iterators': (0, 296752, 1139),
'email.message': (0, 297891, 14893),
'email.parser': (0, 312784, 1908),
'email.policy': (0, 314692, 3735),
'email.quoprimime': (0, 318427, 3849),
'email.utils': (0, 322276, 5367),
'enum': (0, 327643, 7102),
'fnmatch': (0, 334745, 1621),
'ftplib': (0, 336366, 13753),
'genericpath': (0, 350119, 1531),
'getopt': (0, 351650, 3221),
'getpass': (0, 354871, 2483),
'gettext': (0, 357354, 5593),
'gi': (1, 362947, 2194),
'gi._constants': (0, 365141, 571),
'gi._error': (0, 365712, 726),
'gi._gobject': (1, 366438, 173),
'gi._option': (0, 366611, 5197),
'gi._propertyhelper': (0, 371808, 5061),
'gi._signalhelper': (0, 376869, 3603),
'gi.docstring': (0, 380472, 2141),
'gi.importer': (0, 382613, 1918),
'gi.module': (0, 384531, 3158),
'gi.overrides': (1, 387689, 5218),
'gi.overrides.GLib': (0, 392907, 11586),
'gi.overrides.GObject': (0, 404493, 8686),
'gi.overrides.Gdk': (0, 413179, 5215),
'gi.overrides.Gio': (0, 418394, 3197),
'gi.overrides.Gtk': (0, 421591, 18417),
'gi.overrides.Pango': (0, 440008, 720),
'gi.repository': (1, 440728, 247),
'gi.types': (0, 440975, 4178),
'glob': (0, 445153, 1413),
'gzip': (0, 446566, 8386),
'hashlib': (0, 454952, 3173),
'html': (1, 458125, 2104),
'html.entities': (0, 460229, 25665),
'http': (1, 485894, 68),
'http.client': (0, 485962, 14494),
'http.cookiejar': (0, 500456, 24103),
'http.server': (0, 524559, 17252),
'imp': (0, 541811, 4545),
'importlib': (1, 546356, 1998),
'importlib._bootstrap': (0, 548354, 26964),
'importlib.machinery': (0, 575318, 564),
'importlib.util': (0, 575882, 2806),
'inspect': (0, 578688, 30609),
'logging': (1, 609297, 21714),
'lzma': (0, 631011, 6586),
'mimetypes': (0, 637597, 6628),
'ntpath': (0, 644225, 6002),
'nturl2path': (0, 650227, 944),
'opcode': (0, 651171, 2389),
'optparse': (0, 653560, 19225),
'os': (0, 672785, 11499),
'pdb': (0, 684284, 20789),
'pickle': (0, 705073, 17731),
'pkgutil': (0, 722804, 7853),
'platform': (0, 730657, 13776),
'plistlib': (0, 744433, 12244),
'posixpath': (0, 756677, 4777),
'pprint': (0, 761454, 5326),
'py_compile': (0, 766780, 3141),
'pydoc': (0, 769921, 38213),
'pydoc_data': (1, 808134, 74),
'pydoc_data.topics': (0, 808208, 111994),
'quopri': (0, 920202, 3245),
'random': (0, 923447, 8634),
'selectors': (0, 932081, 5884),
'shlex': (0, 937965, 3561),
'shutil': (0, 941526, 14083),
'socket': (0, 955609, 7882),
'socketserver': (0, 963491, 8217),
'ssl': (0, 971708, 11892),
'stat': (0, 983600, 1599),
'string': (0, 985199, 3828),
'stringprep': (0, 989027, 6008),
'subprocess': (0, 995035, 17219),
'tarfile': (0, 1012254, 27909),
'tempfile': (0, 1040163, 8492),
'textwrap': (0, 1048655, 5834),
'threading': (0, 1054489, 13991),
'token': (0, 1068480, 1956),
'tokenize': (0, 1070436, 9963),
'tty': (0, 1080399, 643),
'unittest': (1, 1081042, 1643),
'unittest.case': (0, 1082685, 17886),
'unittest.loader': (0, 1100571, 5851),
'unittest.main': (0, 1106422, 3505),
'unittest.result': (0, 1109927, 3313),
'unittest.runner': (0, 1113240, 3027),
'unittest.signals': (0, 1116267, 1173),
'unittest.suite': (0, 1117440, 4187),
'unittest.util': (0, 1121627, 2700),
'urllib': (1, 1124327, 70),
'urllib.error': (0, 1124397, 1251),
'urllib.parse': (0, 1125648, 12188),
'urllib.request': (0, 1137836, 30458),
'urllib.response': (0, 1168294, 1403),
'uu': (0, 1169697, 2223),
'warnings': (0, 1171920, 5813),
'webbrowser': (0, 1177733, 7278),
'xml': (1, 1185011, 431),
'xml.parsers': (1, 1185442, 218),
'xml.parsers.expat': (0, 1185660, 236),
'xml.sax': (1, 1185896, 1698),
'xml.sax._exceptions': (0, 1187594, 2237),
'xml.sax.expatreader': (0, 1189831, 5461),
'xml.sax.handler': (0, 1195292, 4142),
'xml.sax.saxutils': (0, 1199434, 5056),
'xml.sax.xmlreader': (0, 1204490, 5464),
'zipfile': (0, 1209954, 20450)}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment