ubuntu上的pygame ImportError:没有名为font的模块

时间:2016-04-01 19:24:03

标签: python ubuntu pygame

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

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

1 个答案:

答案 0 :(得分:0)

不是通过conda install安装,而是安装pygame:python-pygame的Ubuntu软件包,它位于Universe中。

喜欢这个

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