获取Matplotlib的依赖项时出错

时间:2015-10-07 23:24:58

标签: python ubuntu matplotlib vagrant virtualenv

我正在尝试从源代码安装python包matplotlib。我无法使用sudo apt-get install python-matplotlib从存储库安装软件包,因为我需要能够使用virtualenv文件在requirmenets.txt中安装软件包。当我按照instructions安装依赖项时,我收到以下错误:

vagrant@vagrant-ubuntu-trusty-64:~$ sudo apt-get build-dep python-matplotlib
Reading package lists... Done
Building dependency tree
Reading state information... Done
Picking 'matplotlib' as source package instead of 'python-matplotlib'
The following packages have unmet dependencies:
 python3-all-dbg : Depends: libpython3-all-dbg (= 3.4.0-0ubuntu2) but it is not going to be installed
                   Depends: python3-dbg (= 3.4.0-0ubuntu2) but it is not going to be installed
                   Depends: python3.4-dbg but it is not going to be installed
 python3-all-dev : Depends: libpython3-all-dev (= 3.4.0-0ubuntu2) but it is not going to be installed
                   Depends: python3-dev (= 3.4.0-0ubuntu2) but it is not going to be installed
                   Depends: python3.4-dev but it is not going to be installed
 python3-numpy-dbg : Depends: python3-dbg but it is not going to be installed
E: Build-dependencies for python-matplotlib could not be satisfied.

如何解决问题?我已经运行了sudo apt-get updatesudo apt-get upgrade无济于事。我可以直接安装错误消息中列出的依赖项(我认为这是命令的重点)?我甚至没有使用Python 3,所以不关心安装软件包(虽然不知道为什么我需要它们)。当我尝试在虚拟环境中运行pip install -r requirements.txt时,我仍然在安装matplotlib时出错。

1 个答案:

答案 0 :(得分:0)

通常,当您缺少某个存储库时,会收到此消息 - 您可以从/etc/apt/sources.list检查您的活动存储库列表。在您的情况下,您可能会错过-src repo

奇怪的是python3-dev来自主仓库,因此默认情况下应该激活它。

您可以通过编辑文件/etc/apt/sources.list

来添加回购
sudo vi /etc/apt/sources.list

并添加以下行

deb-src http://archive.ubuntu.com/ubuntu/ trusty main restricted
deb-src http://br.archive.ubuntu.com/ubuntu/ trusty-updates main restricted

您可以从this link

获取有关可用回购的更多信息

确保在完成此更改后(重新)运行sudo apt-get update,您应该可以安装依赖项