2013-08-21 46 views
0

我已经安装了Python 2.7和pygame的我的Mac上,但每次我尝试“进口pygame的”的时候,我收到此错误信息:麻烦在Mac上安装Pygame的

Traceback (most recent call last): 
    File "<pyshell#0>", line 1, in <module> 
    import pygame 
    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 

我在做什么错?

回答

0

这是一个典型的体系结构问题。尝试

file /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/base.so 

如果结果行的一个包括你的架构(例如386),那么问题是不是从包装本身,而是来自你的方式启动它。然后,尝试从Python中的32位实例启动它:

python2.7-32 
>>>import pygame 

NB:你可以猜测你的架构

uname -m