在Ubuntu上安装pygame
问题描述:
我想在Ubuntu 16.04系统上安装pygame。我的默认Python是2.7.12。我打开终端,并试图:在Ubuntu上安装pygame
sudo apt-get install python-pygame
我得到这个消息:
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.
然后我试图安装numpy的,并得到了除相同的消息:
The following packages have unmet dependencies:
python-numpy : Depends: python:any (>= 2.7.5-5~)
我该怎么办?
答
想通了。发现终端命令重新安装python:
sudo apt-get purge python && sudo apt-get install python2.7
尝试使用'pip'? –
它是哪个版本的Ubuntu?在Ubuntu(实际上是Xubuntu)16.04 LTS中安装时没有任何问题。 – Nurjan
我使用Ubuntu 16.04 ...我尝试安装pip时出现同样的错误。 – Jonathan