在ubuntu上安装pygame

在ubuntu上安装pygame

本文介绍了在ubuntu上安装pygame的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Ubuntu 16.04 系统上安装 pygame.我的默认 python 是 2.7.12.我打开终端并尝试:

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

我收到了这条消息:

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 并得到相同的消息,除了:

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~)

我该怎么办?

推荐答案

想通了.找到重新安装python的终端命令:

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

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

这篇关于在ubuntu上安装pygame的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 03:09