Forum Discussion
Support for GraphViz in Fabric Notebook
- Anonymous1 year ago
Hi AleisterTJMraz ,
Thanks for reaching out to the Microsoft fabric community forum.
Tried to pip install graphviz in my Fabric NotebookSo as you can see from the shared images graphviz successfully got installed and got imported into fabric.
The error you're encountering isn't due to a lack of Graphviz support in Fabric, but rather it's caused by this specific line in your code:graphviz.Digraph('structs', filename='structs_revisited.gv', node_attr={'shape': 'record'})in your cell. Pyspark is not able to find structs_revisited.gv file.
Please modify the code in such a way that pyspark is able to retieve the file information, so as to bypass the error.
If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thank you
Hi AleisterTJMraz ,
Yeah, GraphViz is super handy for visualizing relationships like that. The issue you're hitting is because Fabric Notebooks (at least for now) don't come with the GraphViz system binaries pre-installed — specifically the dot executable, which is what the Python graphviz package relies on under the hood.
One workaround is to use pydot + matplotlib or even networkx for simpler graphing needs, though they don’t give you the same layout quality as GraphViz. Another option is to generate the .dot file in your notebook and then render it externally (e.g., download and visualize locally or in another environment that has GraphViz installed).
If you're working in a Spark context and need something more integrated, you might consider exporting the graph data and using Power BI or another viz tool that supports custom visuals.
Would be cool if Fabric added native support for this in the future. Maybe worth submitting as an idea?
If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.