June 25th, 2013, 02:48 PM
Pyinstaller: packaging multiple python scripts under Mac
This is my first time using pyinstaller. My goal is to build an .app in Mac Mountain Lion. The app is basically a GUI written in PySide, and I have about 7 different Python scripts + 1 .png file. The main file calls 4 of the files, and the 4 files will call the rest of the 2 files repeatedly. The .png file is nothing but the window logo. Could someone help me with some diagnosis? I do not know what went wrong. I searched a lot of documentations online, i.e., change spec, add import, ... etc. but my app still doesn't run.
FYI, Pyinstaller could generate an app for me, but there are two issues:
1. Icon is not changed for the app.
2. App crashes when opened.
My Python version is 2.7.5 and I am using PyInstaller-2.0. Here is my code for packaging:
Here is the spec file:
python pyinstaller.py --onefile --windowed --name=MyApplication -i ~/Documents/AASource/icon.ico ~/Documents/AASource/Scripts/main_file.py
Here is part of the crash message:
# -*- mode: python -*-
a = Analysis(['/Users/boxuancui/Documents/AASource/Scripts/main_file.py'],
pyz = PYZ(a.pure)
exe = EXE(pyz,
console=False , icon='/Users/boxuancui/Documents/AASource/icon.ico')
app = BUNDLE(exe,
Thanks in advance! Any help will be appreciated!
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000000000054d8