[英]Importing pygame raises an ImportError
我已經使用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
我一直在安裝諸如pip,Distribute,py2app之類的python軟件包堆,因此其中某些東西可能會“破壞” pygame嗎?
您可能已經安裝了2個SDL庫,找到所有出現的sdl並僅重新安裝一個,或者刪除1個並保留另一個。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.