I'm trying to pack a python tool I wrote into an exe file for use on Windows 10. As far as I know, the exe is built correctly. It loads and everything works if I run it from the command line.
However, if I try to run the tool from Explorer (double-clicking the icon), I get a "Failed to execute script" error. I've tried building it using the --debug switch, hoping that I could quickly catch any output before cmd closes, but it's just too fast.
The line I use to build the tool is:
pyinstaller.exe --onefile --debug --console --icon=C:\Users\Ross\Desktop\gtt\assets\icon.ico --hidden-import xlrd gtt.py
It worked perfectly before I began using the reportlab modules:
from reportlab.lib import colors
from reportlab.lib.enums import TA_CENTER
from reportlab.lib.pagesizes import letter, portrait
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import inch
from reportlab.platypus import SimpleDocTemplate, Table, TableStyle, Paragraph, Spacer
The command line gives absolutely no output regarding errors when I run it using the debug switch:
I've tried the following and nothing has worked.
- --noupx
- --onedir
- --onefile
To sum it up, why would a PyInstaller exe file work when run from the command line, but not from the Windows GUI?
EDIT: The issue seems to be with PyQt4. I went back to a commit where I switch from tkinter to Qt and the issue is still there. The previous build, with tkinter, loads fine from the GUI.