2013-08-21 188 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