python 安装 graphviz 包(Mac)
1、先安装homebrew
在终端运行以下内容
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
2、通过以下命令配置路径
==> Next steps:
- Run these three commands in your terminal to add Homebrew to your PATH:
echo '# Set PATH, MANPATH, etc., for Homebrew.' >> /Users/penny/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/penny/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"```
3、brew install graphviz
4、在python中加入一行代码
import os
os.environ["PATH"] += os.pathsep + '/opt/homebrew/Cellar/graphviz/7.0.0/bin/'