ubuntu上的pygame导入错误:没有名为font的模块



我在Ubuntu 14.04 上运行Python 2.7.11

我试着跑https://github.com/asrivat1/DeepLearningVideoGames教我的电脑打乒乓球,但我陷入了pygame错误,似乎找不到解决方案。

当运行deep_q_network.py时,我得到以下错误:

Wrapped Game Code/pong_fun.py:31: RuntimeWarning: use font: No module named font
(ImportError: No module named font)
 font = pygame.font.SysFont("calibri",40)
Traceback (most recent call last):
 File "deep_q_network.py", line 7, in <module>
  import pong_fun # whichever is imported "as game" will be used
 File "Wrapped Game Code/pong_fun.py", line 31, in <module>
  font = pygame.font.SysFont("calibri",40)
 File "/home/me/anaconda2/lib/python2.7/site-packages/pygame/__init__.py", line 70, in __getattr__
  raise NotImplementedError(MissingPygameModule)
NotImplementedError: font module not available
(ImportError: No module named font)

我使用conda install -c https://conda.anaconda.org/tlatorre pygame安装了pygame

与其通过conda-install安装,不如为pygame安装Ubuntu包:python-pygame,它在宇宙中。

像这个

xyzUbuntu:~$ sudo apt-get install python-pygame

最新更新