How to install pygame font

余生长醉 提交于 2019-12-24 14:36:57

问题


This is a beginner level question. I am teaching myself pygame on ubuntu 10.10. I downloaded a couple of examples and pygame isn't working right. I suspect an install problem. But I'm not sure how to figure it out.

Is there something else I have to install to make this work?

  1. My example: http://cid-bb9549bdfdec74f4.skydrive.live.com/self.aspx/PyPlotter/pyplotter.py

  2. My error:

    prompt: python pyplotter.py

    pyplotter.py:27: RuntimeWarning: use font: No module named font

    (ImportError: No module named font) font = pygame.font.SysFont("arial",12)

Traceback (most recent call last):

File "pyplotter.py", line 27, in <module>

font = pygame.font.SysFont("arial",12)

File "/usr/local/lib/python2.6/dist-packages/pygame-1.9.1release-py2.6-linux-i686.egg/pygame/__init__.py",

line 70, in getattr raise NotImplementedError(MissingPygameModule)` NotImplementedError: font module not available (ImportError: No module named font)

3. I installed pygame with: sudo easy_install pygame

This says I have the latest version of pygame.  So, Do i need to install
something different for fonts?

回答1:


Instead of installing through easy_install, install the Ubuntu package for pygame: python-pygame (it's in universe).



来源:https://stackoverflow.com/questions/5255385/how-to-install-pygame-font

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!