20

Trying to generate some PDF's of decision trees by following some of the sklearn documentation, but can't get Pydot on my machine. Is there any way to use the conda installer to install the pydot package? Based on the command line errors I'm seeing, it may be a 64bit issue. I use binstar search to find the package channel:

C:\binstar search -t conda 

Which gives the recommendation of looking at the packages in detail using

binstar show j14r/pydot

Which then tells me to

conda install --channel https://conda.binstar.org/j14r pydot

But when I run the conda install command, I get the following error (same error for all the pydot packages listed):

Fetching package metadata: ...
Error: No Packages found in current win-64 channels matching: pydot
You can search for this package with 

binstar search t conda pydot

which sends me back to the beginning of this all. Any ideas? Thanks all.

Fred Foo
  • 355,277
  • 75
  • 744
  • 836
joe
  • 331
  • 1
  • 2
  • 9

8 Answers8

27

This may help for someone who is looking for For Anaconda on Windows 10 64 Bit, Environment: Windows 10 64 Bit, Python 3.5.2, Anaconda 4.2.0 (64-bit)

  1. Download "graphviz-2.38.msi" from https://graphviz.gitlab.io/_pages/Download/Download_windows.html
  2. Execute the "graphviz-2.38.msi" file
  3. Add the graphviz bin folder to the PATH system environment variable (Example: "C:\Graphviz2.38\bin")
  4. Go to Anaconda Prompt using start menu (Make sure to right click and select "Run as Administrator". We may get permission issues if Prompt as not opened as Administrator)
  5. Execute the command: conda install graphviz
  6. Execute the command: pip install git+https://github.com/nlhepler/pydot.git
  7. Execute the command "conda list" and make sure pydot and graphviz modules are listed. Thanks
Jesper - jtk.eth
  • 7,026
  • 11
  • 36
  • 63
Rajesh Kumar Raj
  • 386
  • 3
  • 10
  • 3
    You can use `import pydot; print pydot.find_graphviz()` to check if you missed a step – jan-glx Mar 03 '17 at 10:10
  • I get this error at step 6 : https://github.com/nlhepler/pydot.git C:\temps\pip-req-build-v85u4f9_ Cannot find command 'git' - do you have 'git' installed and in your PATH? –  May 06 '18 at 21:14
  • Yes, we need to have Git installed and available in PATH. Make sure git is available by executing "git --version" – Rajesh Kumar Raj May 07 '18 at 09:36
  • I did all the steps except one difference: I was activating a conda environment and I was doing it in that environment. It didn't work. Then I switched to base environment and did the steps and it worked. – qqqqq Mar 05 '20 at 00:19
12

I had the same question for my Anaconda3 x64 installation on Windows 8.1.

Here is what I did:

1) Installed Github for Windows https://windows.github.com/

2) Opened the Git Shell (which is a PowerShell session that allows git commands)

3) Install the pydot from https://github.com/nlhepler/pydot with this command:

./pip install git+https://github.com/nlhepler/pydot.git

4) You can check whether pydot was installed by issuing

conda list
4

New pydot link for 64-bit installer https://anaconda.org/rmg/pydot or just

conda install -c rmg pydot

Community
  • 1
  • 1
njjnex
  • 1,490
  • 13
  • 23
3

Try running the following:

conda install -c https://conda.binstar.org/sstromberg pydot
gian1200
  • 3,670
  • 2
  • 30
  • 59
3

Most of the people gave great insights, here's a procedure which I find useful for myself -

assumed conf. -> Anaconda 4.4.0 or higher, Win 8+, and using anaconda prompt

  • Few required installations (no order necessary)
    1. pip install pydot-ng
    2. conda install graphviz
    3. pip install graphviz
  • PATH setting -> Under user environment variables add C:/Anaconda/Library/bin/graphviz in PATH (not Path)
  • Go to C:/Anaconda/Lib/site-packages/keras/utils/
    Now open vis_utils.py in an editor and change line 11 from import pydot to import pydot_ng as pydot
  • All set, now go to Jupyter notebook and type following commands -
    import graphviz
    import pydot_ng as pydot
    pydot.find_graphviz()
    If everything went well then you will find something similar to as shown below -
    {'circo': 'C:\\Anaconda\\Library\\bin\\graphviz\\circo.exe',
    'dot': 'C:\\Anaconda\\Library\\bin\\graphviz\\dot.exe',
    'fdp': 'C:\\Anaconda\\Library\\bin\\graphviz\\fdp.exe',
    'neato': 'C:\\Anaconda\\Library\\bin\\graphviz\\neato.exe',
    'sfdp': 'C:\\Anaconda\\Library\\bin\\graphviz\\sfdp.exe',
    'twopi': 'C:\\Anaconda\\Library\\bin\\graphviz\\twopi.exe'}
sync11
  • 1,224
  • 2
  • 10
  • 23
1

Try this (from Anaconda Prompt):

conda install pydot-ng

Then, in your code:

try:
    import pydot_ng as pydot
except ImportError:
    import pydot # if someone running with old installation

More about Pydot-ng

tony_tiger
  • 789
  • 1
  • 11
  • 25
0

It looks like the j14r pydot package is built for 32-bit Windows, but I'm guessing you are using the 64-bit conda. See https://conda.binstar.org/j14r.

asmeurer
  • 86,894
  • 26
  • 169
  • 240
  • 5
    Yup, exactly. I feel silly for asking, but can you point me to how I can build it for 64-bit? Or, at least install it using the Conda installer? – joe Oct 17 '14 at 16:46
0

For me:

conda install -y pydot

worked. If not try:

conda install -y pydot -c conda-forge

I'm surprised I didn't have to do conda install -y graphviz however.

Charlie Parker
  • 5,884
  • 57
  • 198
  • 323