在 Debian wheezy 上安装 python3-networkx

Install python3-networkx on Debian wheezy

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

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

apt-get install python-networkx

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

如何安装 python3 版本?

要在 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