I had a bunch of these on my project and usually it's just like the message says, some module isn't getting auto compiled in with py2exe's auto crawler. If you expressly add it to the script it fixed my errors. Here's a snipit from my script. note that includes are modules and packages are well packages. don't put a package in includes or a module in packages I found out the hard way it doesn't work.
includes = [
'tarfile', #fixes exportpkg
#GRAMPS modules not being auto pulled in.
packages = [
#GRAMPS packages not being auto pulled in.
'gen', #auto misses gen.proxy and that gen is a package.
name = const.PROGRAM_NAME,
#current version of py2exe barks and doesn't put anything in if alpha
#characters are here
version = numberic_only_re.sub('.', const.VERSION),
#version = "3.1.1",
description = const.COMMENTS,
author = const.AUTHORS,
#author_email = ??,
url = const.URL_HOMEPAGE,
#gets rid of the zip file and puts all the files into the exe
zipfile = None,
windows = [
'icon_resources': [(1, "images\\ped24.ico")],
# console = [
# 'script': 'gramps.py',
# 'icon_resources': [(1, "images\\ped24.ico")],
#'bundle_files': 2, #breaks it for some reason
# Valid values for bundle_files are:
# 3 (default) don't bundle
# 2 bundle everything but the Python interpreter
# 1 bundle everything, including the Python interpreter
'optimize': 2, #2 is same as running python -00
From: Thadeus Burgess <firstname.lastname@example.org>
Sent: Tuesday, April 14, 2009 10:14:58 PM
Subject: [Py2exe-users] font module not available
Would anyone be so kind as to help me figure out why py2exe will not use the font module from pygame?
I have searched for hours and turned up nothing.
I am using the pygame2exe script, and running python 2.6
Obviously I need fonts for a game :)
I have tried solutions such as using font and including pygames default font into the directory, and a few other solutions to no avail.
It does work outside of py2exe
C:\Documents and Settings\Thadeus Burgess\My Documents\NetBeansProjects\MyRTS\dist\My RTS.exe:68:
RuntimeWarning: use font: MemoryLoadLibrary failed loading pygame\font.pyd
Traceback (most recent call last):
", line 106, in <module>
File "myrts.py", line 75, in run
File "scene.pyo", line 97, in load
File "widgets.pyo", line 107, in __init__ #loads the pygame.font module here.
File "pygame\__init__.pyo", line 70, in __getattr__
NotImplementedError: font module not available