2013-05-10 6 views
1

내가 맥 OS X를 생성하려면 다음에 "Hello World"파이 게임 응용 프로그램을 얻기 위해 노력하고 있어요 (10.8) 응용 프로그램 사용 pyInstaller 중에 :안녕하세요 세계

import pygame, sys 
import pygame._view 
from pygame.locals import * 

pygame.init() 

# set up the window 
windowSurface = pygame.display.set_mode((500, 400), 0, 32) 
pygame.display.set_caption('Hello world!') 

# set up the colors 
BLACK = (0, 0, 0) 
WHITE = (255, 255, 255) 

# draw the white background onto the surface 
windowSurface.fill(WHITE) 

# draw a black circle onto the surface 
pygame.draw.circle(windowSurface, BLACK, (250, 200), 20, 0) 

# draw the window onto the screen 
pygame.display.update() 

# run the game loop 
while True: 
    for event in pygame.event.get(): 
     if event.type == QUIT: 
      pygame.quit() 
      sys.exit() 

사양 파일

# -*- mode: python -*- 
a = Analysis(['test.py'], 
      pathex=['/Users/ronan/Documents/projects/python/test'], 
      hiddenimports=[], 
      hookspath=None, 
      runtime_hooks=None) 
pyz = PYZ(a.pure) 
exe = EXE(pyz, 
      a.scripts, 
      exclude_binaries=True, 
      name='test', 
      debug=True, 
      strip=None, 
      upx=False, 
      console=False) 
coll = COLLECT(exe, 
       a.binaries, 
       a.zipfiles, 
       a.datas, 
       strip=None, 
       upx=False, 
       name='test') 
app = BUNDLE(coll, name='test.app') 

Pyinstaller는 제대로 작동하는 것으로 보이며 test.app에 dist 폴더를 만듭니다. 그러나 그것은 실행되지 않습니다. 내가 진정한 도전 작업 윈도우 pyInstaller 중에을 받고 있었다하지만 지금은 그것을 가지고

Traceback (most recent call last): 
    File "<string>", line 11, in <module> 
    File "/Users/ronan/Documents/projects/python/test/dist/test/eggs/setuptools-0.6c12dev_r88846-py2.7.egg/pkg_resources.py", line 698, in <module> 
    ... 
    LookupError: no codec search functions registered: can't find encoding 

: 당신은 당신이 다음과 같은 오류가 명령 줄에서 DIST 폴더 excecutable를 실행합니다. 가장 어려운 부분은 일관된 오류 메시지가 없다는 것입니다. 나는 python과 pygame을 정말 좋아하고 단지 전개의이 장애물을 넘기를 원합니다. 분명히 이것은 실제 응용 프로그램이 아니지만 Mac에서이 "Hello World"작업을하고 Windows에서 작업 할 때 얻은 지식과 결합하면 대부분을 파악할 수있을 것입니다. 또한, 만약 내가 이것을 이해한다면, 다른 파이 게임 개발자들에게 도움이 될 수 있다고 생각합니다.

답변

1

Mac의 경우 cx_Freeze를 사용하는 것이 더 좋을 수도 있습니다.

+0

나는 이것을 검사 할 것입니다. 감사 – RonanOD

관련 문제