我不明白发生了什么,但我似乎不再能够从 PyCharm 内部绘制石榴图。我使用 conda 作为包管理器,并且已经完成了通常的操作:
conda install graphviz
conda install python-graphviz
但每次我model.plot()
从 PyCharm 内部打电话时,我都会得到
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
,但似乎没有什么区别