Ubuntu安装igraph作为图计算和社交分析的常用包。
1, 安装sudo pip3 install igraph
报错信息如下:
“DeprecationWarning: To avoid name collision with the igraph project, this visualization library has been renamed to ‘jgraph’. Please upgrade when convenient.”
报错原因:
通过pip list发现Python安装的有igraph包有两个:igraph、python-igraph。实际上,只需要安装python-igraph。
2, 卸载包igraph
sudo pip3 uninstall igraph
3,重新安装包python-igraph
sudo pip3 install python_igraph
报错开始:
报错(1),因为igraph是依赖于C语言的,需要C编译器,报错如下:

解决:尝试了一些解决方法都失败了,不使用pip安装,采用如下方式:
sudo add-apt-repository ppa:igraph/ppa
sudo apt-get update
sudo apt-get install python-igraph
依然报C core错误。在官网可以了解到,从版本0.5开始,igraph库的C core不包含在Python发行版中 ,必须单独编译和安装C core。在ubuntu中,需要下载build-essential 和 python-dev 编译C core。
sudo apt-get install build-essential
sudo apt-get install python-dev
sudo apt install pkg-config
(2),重试sudo apt-get install python-igraph,报错:

解决:安装Python的头文件和静态库包::
sudo apt-get install python-dev
sudo apt-get install python3-dev
sudo apt install python3.6-dev
到此依赖安装好了。

完成以上操作,可验证Python中能否成功加载igraph包。
from igraph import *
本文详细介绍了在Ubuntu系统中安装igraph包的过程,包括解决安装冲突、依赖问题及编译Ccore的具体步骤。
1470

被折叠的 条评论
为什么被折叠?



