pomegranate unable to detect existing pygraphviz

438 Views Asked by At

I am trying to work with Pomegranate package in python 3.7, Win 10 environment.

I had trouble with installing pygraphviz package (It was a nightmare). I finally ended up installing the package following this post. Now, when I tried working with pomegranate it throws the error " must have pygraphviz installed for visualization." I confirmed that pygraphviz is installed on my system by running this file.

Why pomegranate is not able to locate my pygraphviz package?

enter image description here

3

There are 3 best solutions below

0
On

I ran into this issue two years later. Did you manage to find a solution? While my conda dev environmet was up to date, I got this issue when I tried to install pygraphviz

$> pygraphviz -> python[version='>=2.7,<2.8.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0|>=3.5,<3.6.0a0']
$> Your python: python=3.8

To install pygraphviz, I changed Python version to 3.6 and ran 'conda install pygraphviz'. This worked fine.

Interestingly, when I reverted the version of Python back to 3.8, pygraphviz still worked.

0
On

Sharing here as well, as per this SO thread it seems that the issue could be related to the pomegranate code catching import errors for matplotlib and pygraphviz with the same try statement.

If matplotlib is missing, installing it will remove this error message.

0
On

got same problem, I have installed pygraphviz and pillow with conda in order to solve it.

PS. I have restarted the kernel (with dialog) in jupyter to make it work