How to install pygame font

2019-08-04 18:12发布

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条回答
beautiful°
2楼-- · 2019-08-04 18:45

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

查看更多
登录 后发表回答