【问题标题】:py2exe font module not availablepy2exe 字体模块不可用
【发布时间】:2012-02-07 12:48:14
【问题描述】:

我的主要文件:

setup.py:

from distutils.core import setup
import pygame._view
import py2exe
import pygame

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

game.py:

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

pygame.init()
screen = pygame.display.set_mode([550,450])
screen.fill([255,255,255])
fnt = pygame.font.Font(None, 35)
wrt = fnt.render('Help', True, [0,0,0])
screen.blit(wrt,[235,103])
pygame.display.update()

start = True
while start:
   for event in pygame.event.get():
       if event.type == QUIT: 
          pygame.quit()

然后我打开 CMD 并输入:“python setup.py py2exe”
完成后,我尝试运行 game.exe 文件
它向我显示了一个错误:

http://i40.tinypic.com/10cqb11.png

感谢您的帮助。

【问题讨论】:

标签: python pygame py2exe


【解决方案1】:

我遇到了同样的问题,我在这里找到了确切的解决方案:http://pygame.org/wiki/Pygame2exe

请注意您不需要使用“py2exe”参数运行此代码,因为它已经存在:

sys.argv.append('py2exe')

【讨论】:

    猜你喜欢
    • 2013-07-23
    • 1970-01-01
    • 2015-01-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多