ubuntu 安装 graphviz graphviz-dev pygraphviz

graphviz

这个我之前已经装过了
一般来说 pip install graphviz 即可

graphviz-dev

试了好多次pip install 都不行 换镜像源也不行
一直报错
Could not find a version that satisfies the requirement graphviz-dev (from versions: )
No matching distribution found for graphviz-dev
后来发现

apt-get graphviz-dev

就可以

pygraphviz

pip install pygraphviz 不行 出错 错误很长一串看不懂 大概就是少一些安装的路径设置
因此参考了博客 解决使用pygraphviz出现的ImportError
总结一下就是

pkg-config --libs-only-L libcgraph
pkg-config --cflags-only-I libcgraph

会得到graphviz的路径比如-I/usr/include/graphviz/
然后根据这个路径,安装pygraphviz

pip install pygraphviz --install-option="--include-path='/usr/include/graphviz/'" --install-option="--library-path='/usr/lib/graphviz/'"

即可

坑1: make sure the Graphviz executables are on your systems’ PATH

安装完上面三个,跑程序,报错ExecutableNotFound: Executab…’ PATH",)
这个错误应该就是下面这个
make sure the Graphviz executables are on your systems’ PATH
解决方法:
参考网址解决方法
总结下来就是:graphviz还是有点问题啊
使用

sudo apt-get install graphviz

而不是pip install 即可解决

你可能感兴趣的:(ubuntu,python,安装包)