Installing pydot and graphviz packages in Anaconda environment
Question: I want to be able to create graphical decision trees in Python, and I am
currently trying to install both `pydot` and `graphviz`.

I am using Anaconda as my environment (along with Spyder), and have tried to
run the following lines of code

    
    
    conda install -c https://conda.binstar.org/t/TOKEN/j14r pydot
    

with the result

    
    
    Error: unknown host: http://repo.continuum.io/pkgs/pro/win-32/
    Error: unknown host: http://repo.continuum.io/pkgs/free/win-32/
    Error: unknown host: https://conda.binstar.org/t/TOKEN/j14r/win-32/
    Error: No packages found matching: pydot
    

I have also tried using `pip install pydot` and `pip install graphviz` with
similar results:

    
    
    Downloading/unpacking pydot
      Cannot fetch index base URL https://pypi.python.org/simple/
      Could not find any downloads that satisfy the requirement pydot
    Cleaning up...
    No distributions at all found for pydot
    Storing complete log in [...]
    

I am getting pretty bored at trying to figure out how to go about this, so I
was hoping anyone out there could give me some tips perhaps.

Thanks


Answer: I had the same issue and solved it by (order is **important**):

  1. Installing `graphviz`, simply via `sudo apt-get install graphviz`
  2. Installing `graphviz` for Python via conda `sudo ~/anaconda2/bin/conda install graphviz`
  3. Finally, by installing `pydot` using conda `sudo ~/anaconda2/bin/conda install pydot`

This answer is overdue but this post helped me (together with [this
one](http://stackoverflow.com/questions/18438997/why-is-pydot-unable-to-find-
graphvizs-executables-in-windows-8) that mentions the installation order), so
hopefully this answer will help someone else. I'm using Ubuntu 14.04 and
Python 2.7.

P.S. apparently, there could be some issues with step 1 of the above
algorithm, [this post](http://askubuntu.com/questions/196230/how-do-i-install-
graphviz-2-29-in-12-04) mentions how to fix them.

