pygame的字体画不出来_Pygame:字体模块不可用

在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)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值