我在Mac OSX 10.9.2上使用IDLE Python 2.7。我在python中运行了以下代码。
from pygame.locals import *
pygame.init()
DISPLAYSURF = pygame.display.set_mode((400, 300))
pygame.display.set_caption('Hello World!')
while True: # main game loop
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
sys.exit()
pygame.display.update()
我收到此错误:
Traceback (most recent call last):
File "/Users/amar/Development/Pygame - Hello World - Py3.4.py", line 1, in <module>
import pygame, sys
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site- packages/pygame/__init__.py", line 95, in <module>
from pygame.base import *
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site- packages/pygame/base.so, 2): no suitable image found. Did find:
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site- packages/pygame/base.so: no matching architecture in universal wrapper
我已经正确安装了pygame,我一直在寻找解决方案。
提前致谢!