0

MAIN QUESTIONS: Does anyone know why I'm not getting reproducible error messaging on a Pyinstaller application? Is there some temporary data/memory stored after/between pyinstaller .exe runs that I'm missing?

DETAILS:

The first time I run it I see an error pop up and the application closes very quickly, the second time no error populates and it closes after some time.

Note: I've tried

The only way I can get the error to show again is by recompiling the application.

here's my .spec file...

# -*- mode: python ; coding: utf-8 -*-
import sys
import os
site_packages_dir = next(p for p in sys.path if 'site-packages' in p)
block_cipher = None


a = Analysis(['src\\dag\\app.py'],
             pathex=['.\\src\\'], # added so relative imports work
             binaries=[],
             datas=[],
             hiddenimports=[],
             hookspath=[],
             hooksconfig={},
             runtime_hooks=[],
             excludes=[],
             win_no_prefer_redirects=False,
             win_private_assemblies=False,
             cipher=block_cipher,
             noarchive=False)
             
# include assets folder in dist: https://stackoverflow.com/a/42061755/12728698           
a.datas += Tree('.\\assets', prefix='assets\\')

site_packages_list = ['distributed']
for package in site_packages_list:
    a.datas += Tree(os.path.join(site_packages_dir, package), prefix=(package + '\\'))

pyz = PYZ(a.pure, a.zipped_data,
             cipher=block_cipher)

exe = EXE(pyz,
          a.scripts,
          a.binaries,
          [],
          exclude_binaries=True,
          name='app',
          debug=False,
          bootloader_ignore_signals=False,
          strip=False,
          upx=True,
          console=True,
          disable_windowed_traceback=False,
          target_arch=None,
          codesign_identity=None,
          entitlements_file=None )
coll = COLLECT(exe,
               a.binaries,
               a.zipfiles,
               a.datas, 
               strip=False,
               upx=True,
               upx_exclude=[],
               name='app')
joshp
  • 706
  • 5
  • 22
  • do you get problem when you run `pyinstaller` or when you run program created by `pyinstaller`? In both situations you should run it in console/terminal to see error messages. And only full error message may explain what is the problem. – furas Jun 10 '22 at 01:07
  • @furas when I run the program created by `pyinstaller`, I've tried running in terminal and it seems random when it actually shows an error message, but I have to double click the `app.exe` for it to happen... it's really strange and unfortunately irregular – joshp Jun 10 '22 at 01:10
  • the only idea to use `print()` to debug code - use `print()` in many places to see which part of code is executed and what you have in variables when there is in problem. – furas Jun 10 '22 at 01:12
  • @furas I do see an error pop up sometimes.... Do you know if there's any hidden cache files/memory that get's left after a `pyinstaller` created `.exe` run? – joshp Jun 10 '22 at 01:38
  • open console and run program in console to see error message in console instead of popup message. – furas Jun 10 '22 at 07:20
  • as I remeber `pyinstaller`creates folder `build` and `dist` and in one it gathers files which it uses to create `.exe` - and it put it in another file. But without full error message it is hard to say what is the problem. And using `print()` can also see in which place is problem. – furas Jun 10 '22 at 07:32

0 Answers0