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.

Leave a Comment