2011-06-16 1 views
3

J'ai utilisé Pygame2exe à partir du site Web de Pygame et cela s'est débarrassé du problème avec le .dlls mais il y a toujours une erreur qui reste.
La seule police que j'utilise est la police standard de pygame (freesansbold.ttf) et j'en ai inclus une copie dans mon répertoire de jeu. J'utilise la classe Font et non la classe SysFonts dont je pensais qu'elle réglerait mon problème.
Des pensées?Erreur de module de police lors de l'utilisation de pygame2exe

C:\Python26\apple_orchard\dist\appleorchard.exe:27: RuntimeWarning: use font: MemoryLoadLibrary failed loading pygame\font.pyd 
(ImportError: MemoryLoadLibrary failed loading pygame\font.pyd) 
Traceback (most recent call last): 
    File "appleorchard.py", line 165, in <module> 
    File "appleorchard.py", line 27, in __init__ 
    File "pygame\__init__.pyo", line 70, in __getattr__ 
NotImplementedError: font module not available 
(ImportError: MemoryLoadLibrary failed loading pygame\font.pyd) 

Répondre

3

Votre problème ressemble très similaire à celui-ci: http://thadeusb.com/weblog/2009/4/15/pygame_font_and_py2exe

Essayez d'ajouter "sdl_ttf.dll" à la liste des dll du système comme celui-ci:

origIsSystemDLL = py2exe.build_exe.isSystemDLL # save the orginal before we edit it 
def isSystemDLL(pathname): 
    # checks if the freetype and ogg dll files are being included 
    if os.path.basename(pathname).lower() in ("libfreetype-6.dll", "libogg-0.dll", "sdl_ttf.dll"): 
      return 0 
    return origIsSystemDLL(pathname) # return the orginal function 
py2exe.build_exe.isSystemDLL = isSystemDLL # override the default function with this one 
+0

Merci! Il n'y a aucun moyen que je l'aurais compris par moi-même! : P –

-1

On dirait que le module pygame.font est manquant. L'avez-vous emballé?

+0

est-ce pas ce que l'erreur dit? – pradyunsg

Questions connexes