2012-07-23 2 views
1

설치 파일에 다음 코드를 작성했으며 sdl_ttf.dll, "SDL.dll"을 기본 폴더에 모두 포함 시켰습니다.NotImplementedError : 글꼴 모듈을 사용할 수 없습니다.

NotImplementedError:font module not available 
<Import error: DLL load failed:can't find assigned module> 

코드

from distutils.core import setup 

import py2exe,sys,os 
import pygame 

setup(console=['blackjack.py']) 

origIsSystemDLL = py2exe.build_exe.isSystemDLL 
def isSystemDLL(pathname): 
     if os.path.basename(pathname).lower() in ["sdl_ttf.dll", "SDL.dll"]: 
       return 0 
     return origIsSystemDLL(pathname) 
py2exe.build_exe.isSystemDLL = isSystemDLL 

pygamedir = os.path.split(pygame.base.__file__)[0] 
os.path.join(pygamedir, pygame.font.get_default_font()), 
os.path.join(pygamedir, 'SDL.dll'), 
os.path.join(pygamedir, 'SDL_ttf.dll') 

는 문제가 있습니다 : , 그것은 오류 메시지가 표시?

답변

0

수표

if os.path.basename(pathname).lower() in ["sdl_ttf.dll", "SDL.dll"]: 

당신은 파일 이름에 lower()를 호출하고 있기 때문에, 작동하지만 대신 sdl.dllSDL.dll을 사용하므로 py2exe에는 SDL 라이브러리를 포함하지 않습니다.

파이 게임 위키의 this 스크립트를 사용해 볼 수도 있습니다.

관련 문제