我尝试运行一个脚本,它需要 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
您可以查看有关 apt-get 的更多信息 here或在 Linux 终端中使用 man apt-get
。
您还可以查看 pip 文档 here .
关于python - 在 Debian wheezy 上安装 python3-networkx,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32834293/