gpt4 book ai didi

python - 无法绘制石榴图(找不到 pygraphviz)

转载 作者:行者123 更新时间:2023-12-05 07:28:00 25 4
gpt4 key购买 nike

我无法理解发生了什么,但我似乎无法再从 PyCharm 内部绘制石榴图。我正在使用 conda 作为包管理器,并且已经照常进行了:

conda install graphviz
conda install python-graphviz

但每次我从 PyCharm 内部调用 model.plot() 时,我都会得到

Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/Applications/PyCharm.app/Contents/helpers/pydev/_pydev_bundle/pydev_umd.py", line 198, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "/Applications/PyCharm.app/Contents/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/Users/.../xai/import.py", line 36, in <module>
model.plot()
File "pomegranate/BayesianNetwork.pyx", line 281, in pomegranate.BayesianNetwork.BayesianNetwork.plot
ValueError: must have pygraphviz installed for visualization

我显然已经尝试安装 pygraphviz 但它似乎没有什么区别

最佳答案

我刚遇到同样的问题。我解决了安装 graphviz 开发包的问题。在 openSUSE 存储库中,它被称为 graphviz-devel

它的描述是这样的:

The graphviz-devel package contains all that's necessary for developing programs that use the graphviz libraries including man3 pages.

关于python - 无法绘制石榴图(找不到 pygraphviz),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53630549/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com