简体   繁体   中英

Importing pygame raises an ImportError

I've been using pygame and python for a while now, and never has pygame ever raised this issue:

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

I've been installing heaps of python packages like pip, Distribute, py2app and more so could some of those things be "breaking" pygame?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM