【问题标题】:Installing pygame on ubuntu在 ubuntu 上安装 pygame
【发布时间】:2016-09-28 01:44:17
【问题描述】:

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

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

我该怎么办?

【问题讨论】:

  • 是哪个版本的 Ubuntu?在 Ubuntu(实际上是 Xubuntu)16.04 LTS 中安装它没有任何问题。
  • 我使用的是 Ubuntu 16.04...我在尝试安装 pip 时遇到了同样的错误。

标签: python linux ubuntu numpy pygame


【解决方案1】:

想通了。找到一个终端命令重新安装python:

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

【讨论】:

    【解决方案2】:
    sudo apt-get install -f
    

    它修复了损坏的依赖项

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-10-01
      • 1970-01-01
      • 1970-01-01
      • 2015-12-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-19
      相关资源
      最近更新 更多