py2exe makes pygame.sysFont crash

I have a small game that runs fine on Windows XP with just the interpreter, but after using py2exe to create an executable, the new exe crashes with this error message: ------------------------ Pygame Parachute Traceback: File "pygame\sysfont.pyc", line 253, in SysFont Fatal Python error: (pygame parachute) Segmentation Fault This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. ---------------------------------------------- I'm using python 2.3 and pygame 1.6. I assume that I need to explicitly add a library, but I'm not sure what or how. I hope someone might be able to assist me. Here is the py2exe code: ---------------------------------------------- import time import sys # ModuleFinder can't handle runtime changes to __path__, but win32com uses them try: import modulefinder import win32com for p in win32com.__path__[1:]: modulefinder.AddPackagePath("win32com", p) for extra in ["win32com.shell"]: #,"win32com.mapi" __import__(extra) m = sys.modules[extra] for p in m.__path__[1:]: modulefinder.AddPackagePath(extra, p) except ImportError: # no build path setup, no worries. raise RuntimeError("no can load win32com?") pass from distutils.core import setup import py2exe setup( # The first three parameters are not required, if at least a # 'version' is given, then a versioninfo resource is built from # them and added to the executables. version = "0.2.01", description = "py2exe script", name = "The Witch's Yarn", # targets to build console = ["main.py"], #windows = ["main.py"], )

Keith Nemitz <musenik@yahoo.com> writes:
I have a small game that runs fine on Windows XP with just the interpreter, but after using py2exe to create an executable, the new exe crashes with this error message:
------------------------ Pygame Parachute Traceback: File "pygame\sysfont.pyc", line 253, in SysFont Fatal Python error: (pygame parachute) Segmentation Fault
This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. ----------------------------------------------
I'm using python 2.3 and pygame 1.6. I assume that I need to explicitly add a library, but I'm not sure what or how. I hope someone might be able to assist me. Here is the py2exe code:
First possibility: when you run the game in the interpreter with 'python -v mygame.py' python will print which modules are imported. Second: run 'python -i mygame.py', which will enter the interactive interpreter after the script finishes. Then you can inspect 'sys.modules' to find out what has been imported. The most important next step, if that has helped, would be to either notify the pygame developers to update their py2exe sample script, and/or write a helpful page in the py2exe wiki. HTH, Thomas
participants (2)
-
Keith Nemitz
-
Thomas Heller