Installing pygame on ubuntu

一笑奈何 提交于 2021-01-29 04:42:33

问题


I am trying to install pygame on an Ubuntu 16.04 system. My default python is 2.7.12. I opened terminal and tried:

sudo apt-get install python-pygame

I got this message:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 python-pygame : Depends: python-numpy (>= 1:1.8.0) but it is not going to be installed
                 Depends: python-numpy-abi9
E: Unable to correct problems, you have held broken packages.

I then tried to install numpy and got the same message except:

The following packages have unmet dependencies:
 python-numpy : Depends: python:any (>= 2.7.5-5~)

What should I do?


回答1:


Figured it out. Found a terminal command to reinstall python:

sudo apt-get purge python && sudo apt-get install python2.7



回答2:


sudo apt-get install -f

it fixes the broken dependencies



来源:https://stackoverflow.com/questions/39736745/installing-pygame-on-ubuntu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!