简体   繁体   English

在Ubuntu上安装pygame

[英]Installing pygame on ubuntu

I am trying to install pygame on an Ubuntu 16.04 system. 我正在尝试在Ubuntu 16.04系统上安装pygame。 My default python is 2.7.12. 我的默认python是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: 然后,我尝试安装numpy并收到以下消息:

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

What should I do? 我该怎么办?

Figured it out. 弄清楚了。 Found a terminal command to reinstall python: 找到一个终端命令来重新安装python:

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

它修复了损坏的依赖关系

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM