I am trying to run the following command dot -Tpng tree.dot -o tree.png
in my terminal to generate my decision tree.. I got the following error -bash: dot: command not found
in terminal.. I made sure I cd
to the dictionary where this tree.dot file is located. Then I tried to install graphviz package... but it comes to this error in the end, and I have no idea what is causing this error. Someone please help me. Thank you, much appreciated! (By the way I am on Mac)
Asked
Active
Viewed 372 times
0

Sheldon
- 169
- 1
- 2
- 12
-
You need to install [GraphViz](https://graphviz.org/) - take a look at [this question](https://stackoverflow.com/questions/43372723/how-to-open-dot-on-mac), which includes notes on installation for macs. `dot` is one of the programs provided by GraphViz. – andrewJames Oct 17 '20 at 01:04
-
Just want to ask.. for graphviz, I have already installed in Python, I can't pip install it again. It seems I need to install graphviz outside python environment again to be able to use dot command in terminal.. – Sheldon Oct 17 '20 at 01:46
-
You have installed Python's _dependencies_ on GraphViz, which are needed to allow Python to use GraphViz tools. If you never installed GraphViz itself then you will not be able to run the `dot` program, or any of the other GraphViz tools (`neato`, `circo` and so on). So, yes, it sounds as if you still need to install GraphViz. – andrewJames Oct 17 '20 at 14:04
-
I cannot install graphviz because I am using pre-release MacOS.. I tried use both Macport and Homebrew, both failed. I am not sure how to do it without the graphviz. – Sheldon Oct 17 '20 at 17:46
-
I recommend asking that in a new question. You can show the commands you tried and the errors that happened - and you can provide full details about the version of MacOS you are using. The mac community may be able to help you (I an not a mac user). – andrewJames Oct 17 '20 at 18:29
-
Thank you, I will go do that! – Sheldon Oct 17 '20 at 19:09