【问题标题】:Install python3-networkx on Debian wheezy在 Debian wheezy 上安装 python3-networkx
【发布时间】:2015-09-29 01:33:18
【问题描述】:

我尝试运行一个脚本,它需要 python3 和 networkx

python3-networkx 不在 apt-repository 中,所以我使用以下方式安装它:

apt-get install python-networkx

但我的脚本仍然崩溃,说找不到 networkx。

如何安装python3版本?

【问题讨论】:

  • 你的意思是如何安装python 3版本的networkx?你现在用的是哪个版本的python?

标签: python linux debian networkx apt-get


【解决方案1】:

要在 Debian 中安装包,您可以运行:

sudo apt-get update
sudo apt-cache search networkx

这表明了这一点:

python-networkx - tool to create, manipulate and study complex networks
python-networkx-doc - tool to create, manipulate and study complex networks - documentation
python3-networkx - tool to create, manipulate and study complex networks (Python3)

然后就可以运行了:

sudo apt-get install python-networkx

或者,您可以使用 pip:

sudo apt-get update
sudo apt-get install python-pip
sudo pip install networkx

我在 jessie 中试过这个,它适用于 python 2.7。

安装python3你可以使用:

sudo apt-get update
sudo apt-get install python3 python3-pip 

以及用于安装networkx:

在 Debian jessie 中:

sudo pip3 install networkx

在 Debian Wheezy 中:

sudo pip-3.2 networkx

您可以在 linux 终端中查看有关 apt-get hereman apt-get 的更多信息。

您也可以查看 pip 文档here

【讨论】:

  • 由于问题是关于 wheezy 的,因此您应该将其添加到您的答案中:使用 pip-3.2 install networkx 在 Debian wheezy 中使用 pip3
  • 对不起,我有一个 jessie,所以我无法测试它。我已经更新了,希望它可以帮助您解决问题。
猜你喜欢
  • 2013-11-30
  • 1970-01-01
  • 1970-01-01
  • 2014-09-28
  • 2018-03-22
  • 2015-12-09
  • 1970-01-01
  • 2017-07-06
  • 1970-01-01
相关资源
最近更新 更多