导入pygame会引发ImportError

时间:2015-10-18 02:49:10

标签: python pygame

我一直在使用pygame和python一段时间了,而pygame从来没有提出过这个问题:

Traceback (most recent call last):
  File "dodgeball.py", line 1, in <module>
    import pygame
  File "/Library/Python/2.7/site-packages/pygame/__init__.py", line 95, in <module>
from pygame.base import *
ImportError: dlopen(/Library/Python/2.7/site-packages/pygame/base.so, 2): Library not loaded: 
@executable_path/../Frameworks/SDL.framework/Versions/A/SDL
Referenced from: /Library/Python/2.7/site-packages/pygame/base.so
Reason: unsafe use of @executable_path in /Library/Python/2.7/site-packages/pygame/base.so with restricted binary

我一直在安装大量的python软件包,如pip,Distribute,py2app等等,所以有些东西可能会“打破”pygame吗?

1 个答案:

答案 0 :(得分:0)

您可能安装了2个SDL库,找到所有出现的sdl并重新安装一个,或者删除1并离开另一个。