My Py2App App Will Not Open. What's the Problem

My py2app app will not open. What's the problem?

To provide a more thorough answer to this whole issue, I'm going to use the aliens.py example.
When built in OS X, you will see quick flash as the game quickly initializes and quits. Opening console reveals an error message similar to

Fatal Python error: (pygame parachute) Segmentation Fault
Job appears to have crashed: Abort trap

I believe the issue is that the default font is not being included during the packaging process.

In the aliens.py sample for instance, throw a supported font into your data folder and change

self.font = pygame.font.Font( None ), 20)

to

self.font = pygame.font.Font( os.path.join('data', 'Copperplate.ttc'), 20)

This should allow the app to complie and play without issue.

Py2app app not launching just asks if I want to terminate the app or open console

I have been facing a problem with the exact same error code (-67062) and managed to resolve it at least for my machine running Python 3.6.8 on macOS 10.14.2.

Open the file ../Sandwich/Contents/MacOS/Sandwich and see the traceback message in Terminal. If tkinter imports are causing your issue like in my case, downgrade py2app via

pip uninstall py2app

and use an older version, e.g.

pip install py2app==0.12

and run py2app again. If you further encounter import problems of unwanted packages, e.g. pillow, you can exclude them with a workaround found here

from setuptools import setup

APP = ['Sandwich.py']
DATA_FILES = []
OPTIONS = {
"excludes": ['pillow', 'Image'] # exclude unwanted dependencies
}

setup(
app=APP,
data_files=DATA_FILES,
options={'py2app': OPTIONS},
setup_requires=['py2app'],
)

Ronald Oussoren discussed debugging ImportErrors in py2app which can be found below for further reading:

https://bitbucket.org/ronaldoussoren/py2app/issues/223/errors-on-compiling-in-py2app-i-have-all

tkinter/py2app created application doesn't show window on initial launch

After doing some extensive research, it would appear that this is a result of setting the 'argv_emulation' option to True in the, py2app, setup.py file.



Related Topics



Leave a reply



Submit