我现在一直在使用 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
有人告诉我问题出在多个 SDL 库上,但我找不到任何重复的 SDL 库。
最佳答案
Apple 引入了系统完整性保护,作为开发者,我们可能需要禁用它。
- 通过重新启动计算机并按住 Command+R 直到 Apple Logo 出现在屏幕上,将 Mac 重新启动到恢复模式。
- 单击“实用程序”>“终端”。
- 在终端窗口中,输入
csrutil disable
并按 Enter。 - 重新启动您的 Mac。
关于python - Pygame崩溃了?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33196196/