Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
AleisterTJMraz
Regular Visitor

Support for GraphViz in Fabric Notebook

GraphViz is one of my favourite code-to-graph tools: https://graphviz.readthedocs.io/en/stable/examples.html#structs-revisited-py 

 

You can create something like this: 

  

AleisterTJMraz_0-1748523272158.jpeg

  

The best part about it, besides just being built from code, is that the objects are automatically spaced around the canvas. 

  

However, it doesn't look like it works out-of-the-box in a Fabric notebook by just using `import graphviz` via PySpark. 

  

AleisterTJMraz_1-1748523455691.png

  

The error ends with: "FileNotFoundError: [Errno 2] No such file or directory: 'xdg-open'" 

 

Is there any workaround for this, or is there any known way of using GraphViz in a Fabric Notebook ? 

  

Thanks ! 

1 ACCEPTED SOLUTION
v-nmadadi-msft
Community Support
Community Support

Hi @AleisterTJMraz ,
Thanks for reaching out to the Microsoft fabric community forum.

Tried to pip install graphviz in my Fabric Notebook

vnmadadimsft_0-1748596788288.png

 

 

vnmadadimsft_1-1748596788294.png

 

vnmadadimsft_2-1748596815627.png

 

 

vnmadadimsft_3-1748596815630.png

 

So 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




View solution in original post

5 REPLIES 5
v-nmadadi-msft
Community Support
Community Support

Hi @AleisterTJMraz ,

As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided by the community members for the issue worked. If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.

 

Thanks and regards

v-nmadadi-msft
Community Support
Community Support

Hi @AleisterTJMraz 

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If our responses has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.


Thank you.

v-nmadadi-msft
Community Support
Community Support

Hi @AleisterTJMraz ,

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

 

v-nmadadi-msft
Community Support
Community Support

Hi @AleisterTJMraz ,
Thanks for reaching out to the Microsoft fabric community forum.

Tried to pip install graphviz in my Fabric Notebook

vnmadadimsft_0-1748596788288.png

 

 

vnmadadimsft_1-1748596788294.png

 

vnmadadimsft_2-1748596815627.png

 

 

vnmadadimsft_3-1748596815630.png

 

So 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




burakkaragoz
Community Champion
Community Champion

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.

Helpful resources

Announcements
September Fabric Update Carousel

Fabric Monthly Update - September 2025

Check out the September 2025 Fabric update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.