[Tutor] Distutils Font Error

Marc Tompkins marc.tompkins at gmail.com
Tue Apr 19 07:04:00 CEST 2011


On Mon, Apr 18, 2011 at 9:57 PM, Greg Nielsen <gollumgreg407366 at gmail.com>wrote:

> Dear Fellow Python Users,
>
>      I am currently working on a small Python 3.1.3 game on a Windows 7
> machine and am attempting to freezing it using Distutils and cx_freeze so I
> can share it with friends and family. Several attempts in I reached an error
> that I am unable to fix and was hoping for some advice. The error is as
> followes.
>
>
> C:\Users\Greg\Documents\NetBeansProjects\Racing1\src\build\exe.win32-3.1>racing1
> .exe
>
> C:\Users\Greg\Documents\NetBeansProjects\Racing1\src\build\exe.win32-3.1\library
> .zip\RacingLibrary.py:335: RuntimeWarning: use font: DLL load failed: %1 is
> not
> a valid Win32 application.
> (ImportError: DLL load failed: %1 is not a valid Win32 application.)
> Traceback (most recent call last):
>   File "C:\Python31\lib\site-packages\cx_Freeze\initscripts\Console3.py",
> line 2
> 7, in <module>
>     exec(code, m.__dict__)
>   File "racing1.py", line 81, in <module>
>   File "racing1.py", line 28, in main
>   File
> "C:\Users\Greg\Documents\NetBeansProjects\Racing1\src\RacingLibrary.py",
> line 335, in __init__
>     self.font = pygame.font.Font("freesansbold.ttf", 20)
>   File "C:\Python31\lib\site-packages\pygame\__init__.py", line 70, in
> __getattr
> __
>     raise NotImplementedError(MissingPygameModule)
> NotImplementedError: font module not available
> (ImportError: DLL load failed: %1 is not a valid Win32 application.)
>
> This error occurs regardless to whether I use a freeware font and save a
> copy of it in the .exe directory or if I attempt to call SysFont("None") Is
> it possible that either Distutils or cx_freeze does not support .ttf? It's
> the best guess I have at the moment. Hopefully someone can shed some light
> into what is really going on here. Thank you to everyone who takes time to
> read this and perhaps even respond with a possible solution. Mr. Nielsen
>
>
It looks like the problem is not with your font, but with the font module -
which I presume is an optional part of Pygame?  I don't use either Pygame or
cx_freeze, so my advice is limited... but that's how I read it.

Does cx_freeze give you some way of selecting which modules/submodules will
be included?  That's where I'd look.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110418/a4b8138d/attachment.html>


More information about the Tutor mailing list