簡體   English   中英

ubuntu ImportError上的pygame:沒有名為font的模塊

[英]pygame on ubuntu ImportError: No module named 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)

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

無需通過conda install進行安裝,而是為pygame安裝Ubuntu軟件包:python-pygame,它位於Universe中。

像這樣

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM