Reputation: 1415
In order to install graphviz, one can follow, this example: https://colab.research.google.com/drive/1_Qb92Hj5_f2rpta67JC0JKXwE2581Ar-#scrollTo=BOa9gIcDo6GS
When I try to install pygraphviz (https://pygraphviz.github.io/) via (https://pypi.org/project/pygraphviz/)
with
!pip install pygraphviz
import pygraphviz as pgv
i get the error
ERROR: Failed building wheel for pygraphviz
although I installed graphviz before. Why?
Upvotes: 10
Views: 7288
Reputation: 729
Though the answer by @korakot solved the issue, but it does not address the issue of installing pygraphviz library in Google Colab.
If you have to do install pygraphviz in Google Colab then the following worked for me.
# graphviz is installed already, but need lib too
!apt install libgraphviz-dev
!pip install pygraphviz
I found this solution here: https://gist.github.com/korakot/a80c04a1945b06e2f4a053f92fecfbf9
Upvotes: 27
Reputation: 40858
You don't need to pip install anything.
Just import graphviz, not pygraphviz.
My minimal example:
https://colab.to/1PVtFECaDgMfVjed4XNtvyeL4pyMvPdAT
Upvotes: 2