top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

problem with pyinstaller: packaging multiple python scripts under Mac

0 votes
557 views

This is my first time using pyinstaller. My goal is to build an .app in Mac. 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:

python pyinstaller.py --onefile --windowed --name=MyApplication -i ~/Documents/AASource/icon.ico ~/Documents/AASource/Scripts/main_file.pyHere is the spec file:

$ -*- mode: python -*- a = Analysis(['/Users/boxuancui/Documents/AASource/Scripts/main_file.py'], pathex=['/Users/boxuancui/Documents/pyinstaller-2.0'], hiddenimports=[], hookspath=None) pyz = PYZ(a.pure) exe = EXE(pyz, a.scripts, a.binaries, a.zipfiles, a.datas, name=os.path.join('dist', 'MyApplication'), debug=False, strip=None, upx=True, console=False , icon='/Users/boxuancui/Documents/AASource/icon.ico') app = BUNDLE(exe, name=os.path.join('dist', 'MyApplication.app'))Here is part of the crash message:

Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x00000000000054d8

Thanks in advance! Any help will be appreciated!

posted Jun 26, 2013 by anonymous

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
+2 votes

Basically, is it possible to compile multiple unrelated python scripts into a single exe file, so when execute it several python programs are run at once.

In order to use this on another machine without python installed and only by using one single file.

+1 vote

I've been developing with python for a while on Ubuntu but will soon be transitioning to full-time python development. I have the option of using a Mac or Ubuntu environment and I'd like to hear any thoughts on the pros and cons of each. Specifically, how's the support for numpy and scipy? How are the IDEs?

Since I generally like working with a Mac, I'd like to hear if there are any significant downsides to python dev on OsX.

+1 vote

I want to write my own Screenshot Taking program in Python for Mac OS X.

Example : Whenever Command + Shift + 3 is pressed ==> whatever is there on the screen, should be grabbed / captured, and should be stored on my local with my own desired path, and name should automatically given as SnapshotX.. as in Snapshot1, Snapshot2, etc...

The same goes with Command + Shift + 4 ==> the only difference is that, it allows you to select a particular area to be captured / grabbed.

Command + Shift + 5 ==> This one is a little bit tricky which I am looking for. This shortcut doesn't exist. I want to create one of my own, where it would grab the entire webpage's screenshot which I am currently working on, and store the name as the webpage's link.

0 votes

How can write a python script which will execute some perl scripts in a gui and shouldn't be post processed....?

+2 votes

Python scripts can run without a main(). What is the advantage to using a main()? Is it necessary to use a main() when the script uses command line arguments? (See script below)

#!/usr/bin/python

import sys

def main():
 # print command line arguments
 for arg in sys.argv[1:]:
 print arg

if __name__ == "__main__":
 main()
...