20

I know this is basic, but I'm pretty stuck. I've never installed python packages on Windows OS before... only Linux.

I downloaded the graphviz-2.38 zip and moved it to my Anaconda packages directory. I unzipped it, and then on the command line tried:

C:\Users\name\Anaconda3\pkgs\graphviz-2.38> pip install graphviz-2.38

This is the error I got:

Could not find a version that satisfies the requirement graphviz-2.38 (from 
versions: )
No matching distribution found for graphviz-2.38

I don't see any setup file within graphviz at all, so I'm a little lost.

adurbin
  • 557
  • 3
  • 6
  • 11

8 Answers8

14

I faced the same issue and just pip install graphviz didn't work for me. In addition, I installed the binaries and set the bin folder in the Windows environment PATH variable, and then it worked.

P.S. this solution installs the 0.8.2 version but works for keras.utils.vis_utils.plot_model which was the problem for me

Hemerson Tacon
  • 2,419
  • 1
  • 16
  • 28
  • 1
    Confirmed working on Win 10 with recent Tensorflow 2.1 install (GPU included) also to get `tensorflow.python.keras.utils.vis_utils.plot_model` working. Installed pydot, pydotplus and graphviz in that order with `pip install ...` then followed this step... including refreshing PATH (e.g. close and reopen `cmd` window before re-running .py script) – omatai May 06 '20 at 00:16
  • for me worked on Win10 for pyAgrum library. Thanks for the tip. – Helder Jun 02 '20 at 15:41
  • Confirmed working on Win 10 with recent Tensorflow 2.3 install (GPU included) `tensorflow.python.keras.utils.vis_utils.plot_model` working – hychou Nov 27 '20 at 02:47
10

If you are using Conda, then run the following: conda install -c anaconda graphviz

Be sure though to run the conda cmd as Admin for avoiding privileges permission errors. The above command will update / install all the requirement, and graphviz will be available in the default environment at C:\ProgramData\Anaconda3 (for windows...Not sure for MAC).

HassanSh__3571619
  • 1,859
  • 1
  • 19
  • 18
10

For me just installing the graphviz library dint work. It was not able to open dot files. So I had to do the following:

  1. Download the stable Graphviz version by clicking Stable 2.38 Windows install packages from here
  2. Install Graphviz library using pip install graphviz
  3. Since you're using windows, check out the installed tool called GVEdit (just search in the start menu), it makes the whole process slightly easier.
  4. The dot files can be opened by selecting File --> Open
Jeril
  • 7,858
  • 3
  • 52
  • 69
4

Just use:

pip install graphviz
Rao
  • 20,781
  • 11
  • 57
  • 77
3

I got "GraphViz's Executables not found" when I tried the program "https://www.w3schools.com/python/showpython.asp?filename=demo_ml_dtree4"

I tried

  1. "pip install graphviz" or
  2. "conda install graphviz". Both of them didn't work for me.

I solve the problem for WIndows-10 as follows:

  1. Go to Graphviz web site: http://wingraphviz.sourceforge.net/wingraphviz/
  2. Setup environment variables, path="...;c:\Program Files (x86)\Graphviz2.38\bin;"
  3. Save the path
  4. From the command Prompt check the "Graphviz" path.
  5. Re-execute the program, the tree is visualized now.
Ram Narasimhan
  • 22,341
  • 5
  • 49
  • 55
Peter Chen
  • 811
  • 6
  • 4
3

For Conda users:

1. conda install graphviz

2. conda install python-graphviz

Thomas Negash
  • 401
  • 4
  • 5
0

I tried

  1. pip install graphviz
  2. conda install graphviz

Both of them didn't work for me.

Adding to the path seem to be the solution. Since I don't have admins right. I can do this temporarily within a script:

import os
os.environ["PATH"] += os.pathsep r"C:\Users\Nameuser\Anaconda3\Library\bin\graphviz"
Sven Eberth
  • 3,057
  • 12
  • 24
  • 29
-1
  • Go to this link: https://www.softpedia.com/get/Others/Miscellaneous/Graphviz.shtml
  • Click on Download.
  • After download being completed, go to your Program Files(x86) and click on Graphviz2.38 folder and click on the bin.
  • Copy the path of the bin, which looks like this 'C:\Program Files (x86)\Graphviz2.38\bin'
  • Then, go to i) Control Panel ii) Then, System iii) Then, click on Advanced System Settings iv) Environmental Variables v) Click on 'Path', go to edit, click on New and paste that copied path i.e. 'C:\Program Files (x86)\Graphviz2.38\bin'. vi) Click on OK