在 ubuntu 14.04中,python3如何安装pygame和 livewires

分享于 

2分钟阅读

ubuntu

  繁體

问题

sudo pip install pygame 出现错误,提示:


Could not find any downloads that satisfy the requirement pygame.


Some externally hosted files were ignored (use --allow-external pygame to allow).


Cleaning up...


No distributions at all found for pygame


Storing debug log for failure in /home/cooldudeabhi/.pip/pip.log



如何修复它们,我使用python 3.4,请帮助我安装两个模块:Pygame和livewires。


答案1

打开终端并键入以下命令,它将在你的系统上安装pygame


sudo apt-get install mercurial python3-pip libfreetype6-dev


sudo apt-get build-dep python-pygame


sudo pip3 install hg+http://bitbucket.org/pygame/pygame



对于livewires,这个包只用于python2.x,因为我在运行时得到以下错误sudo pip3 install livewires


Running setup.py install for livewires


 File"/usr/local/lib/python3.4/dist-packages/livewires/beginners.py", line 201


 raise ExBadParameters,"colour must be from Colour class"


 ^


SyntaxError: invalid syntax



 File"/usr/local/lib/python3.4/dist-packages/livewires/boards.py", line 239


 if k <> l and k <> -l:


 ^


SyntaxError: invalid syntax



 File"/usr/local/lib/python3.4/dist-packages/livewires/games.py", line 110


 raise GamesError,"Cannot have more than on Screen object"


 ^


SyntaxError: invalid syntax




答案2

有一个Ubuntu软件包python-pygame


sudo apt-get install python-pygame





相关文章