安装步骤
- 安装gcc
yum group install "Development Tools"
- 安装python-igraph
sudo pip install python-igraph
使用条件
- 安装 cairocffi
(不安装会出现问题:plotting not available)
yum install cairo-devel
pip install cairocffi
- 修改代码
centos安装完需要修改代码参照:https://github.com/igraph/python-igraph/commit/8864b46849b031a3013764d03e167222963c0f5d
(不修改会出现问题:'bytes' object has no attribute 'encode')
位置一般在: /root/anaconda3/lib/python3.6/site-packages/igraph/drawing/
使用
import cairocffi as cairo
import igraph
- Done!
可能遇到的坑
- 请安装python-igraph,而不是igraph, 两者不是同类
- 请先安装gcc,否则出现安装python-igraph错误:Could not download and compile the C core of igraph. mac上可以先通过brew安装,