在OS X上运行Python 2.7.2和Pygame 1.9.2pre。
另一个不成熟的问题:初始化pygame.font模块会产生一个错误,我不敢......好吧,试图解决自己。我猜这是一个相当通用的pygame相关问题......但我找不到任何解决方案。
import pygame
pygame.init()
pygame.font.init()
给出:
Desktop/font.py:4: RuntimeWarning: use font: dlopen(/Library/Python/2.7/site-packages/pygame/font.so, 2): Library not loaded: /usr/X11/lib/libfreetype.6.dylib
Referenced from: /Library/Frameworks/SDL_ttf.framework/Versions/A/SDL_ttf
Reason: image not found
(ImportError: dlopen(/Library/Python/2.7/site-packages/pygame/font.so, 2): Library not loaded: /usr/X11/lib/libfreetype.6.dylib
Referenced from: /Library/Frameworks/SDL_ttf.framework/Versions/A/SDL_ttf
Reason: image not found)
pygame.font.init()
Traceback (most recent call last):
File "Desktop/font.py", line 4, in
pygame.font.init()
File "/Library/Python/2.7/site-packages/pygame/__init__.py", line 70, in __getattr__
raise NotImplementedError(MissingPygameModule)
NotImplementedError: font module not available
(ImportError: dlopen(/Library/Python/2.7/site-packages/pygame/font.so, 2): Library not loaded: /usr/X11/lib/libfreetype.6.dylib
Referenced from: /Library/Frameworks/SDL_ttf.framework/Versions/A/SDL_ttf
Reason: image not found)
这到底出了什么问题?字体模块无法使用的可能原因是什么?常见原因?常见修复?
如果有人能够告诉我什么是错的,即使它没有解决问题我也会很感激!
非常感谢!
编辑:我正在使用64位版本的Python和32位Pygame。 (似乎没有适用于Mac OS的64位Pygame)