The Pain, errr, Joy of Getting GraphViz to Work in VSCode (Windows 11)

Tags

, , , , , , , , , , , , , , , ,

After hours of scouring multiple sites (such as stackexchange the one you cannot be kind to others by giving them props for something you were looking for – I did not want to use this site but not many sites had answers – this was one of the sites, also, with no solid answer) in getting GraphViz to work in VSCode. So many sites had old, invalid answers. There was just no solid, clear direction on this but I saw that there were a LOT of folks looking for a viable answer. By the way, for folks who do not know what GraphViz is for, it is for the dot product results of training/testing a Machine Learning (ML) model – used to visualize a graph – a data tree from the models’ results.

Instead of working on my Python and Machine Learning studies, I dug in to get an answer that worked for the rest of us. Here are a couple of the primary answers (no longer valid) being spread around the ‘Net for the past few years:

  • Graphviz (dot) language support for Visual Studio Code — by Stephanvs
    or the
  • graphviz — by Joao Pinto – but…. unfortunately, that one is no longer available as an extension

Sadly, neither of those two worked… Here is a process, best option I found was to use the

  • graphviz preview by EFanZH on the marketplace visualstudio site

So, after – and after exiting VSCode, did the following:

a) Installed GraphViz (for all users)

  • either directly from the marketplace or via the
  • VSCode extension install method – I prefer the direct install for this one… but….
  • powershell install is another way using ===>> winget install graphviz

b) in powershell, verified it was up with dot -V

c) edited the system PATHs (both of them) in environmental variables, using:  C:\Program Files\Graphviz&C:\Program Files\Graphviz\bin for both PATH sections

d) restarted the PC (just in case)

e) opened VSCode

There it is…

Just remember to install the necessary libraries/packages in Jupyter Notebook (in the environment or venv you are working in) and the necessary extensions in VSCode…

Another highly useful site for graphviz information: New simplified installation procedure on Windows

Now…. just have to go on and get LaTeX (pylatex) installed in my environments to do stuff like yhat and y is a member R, etc., etc., etc…

So, if you want to give more than facts/explicit answers, the stackexchange sites are not for you.

Shortened URL for this page –>> http://tinyurl.com/uxn3cssf