title: subprocess call unable to find dot although it's installed
body: <p>I'm following this <a href="https://gist.github.com/WillKoehrsen/ff77f5f308362819805a3defd9495ffd" rel="nofollow noreferrer">this sample code</a> provided by <a href="https://towardsdatascience.com/how-to-visualize-a-decision-tree-from-a-random-forest-in-python-using-scikit-learn-38ad2d75f21c" rel="nofollow noreferrer">this article</a>. The IDE is Spyder 4.1.5 with Python 3.8, anaconda got the below exception saying &quot;FileNotFoundError: [WinError 2] The system cannot find the file specified&quot;.</p>
  <p>I'm new to python (and Spyder), so not sure what file was missing as the exception message didn't include a filename. Any hint will be highly appreciated.</p>
  <p>I've checked the environment, <code>dot</code> is available in path, and package <code>graphviz</code> has been installed.</p>
  <p><strong>Exception trace:</strong></p>
  <pre><code>runfile('C:/my/work/smlb/challenge_1/code/tree_to_image.py', wdir='C:/my/work/smlb/challenge_1/code')
  Traceback (most recent call last):
  
    File &quot;C:\my\work\smlb\challenge_1\code\tree_to_image.py&quot;, line 31, in &lt;module&gt;
      call(['dot', '-Tpng', 'tree.dot', '-o', 'tree.png', '-Gdpi=600'])
  
    File &quot;C:\Users\user\anaconda3\lib\subprocess.py&quot;, line 340, in call
      with Popen(*popenargs, **kwargs) as p:
  
    File &quot;C:\Users\user\anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py&quot;, line 105, in __init__
      super(SubprocessPopen, self).__init__(*args, **kwargs)
  
    File &quot;C:\Users\user\anaconda3\lib\subprocess.py&quot;, line 854, in __init__
      self._execute_child(args, executable, preexec_fn, close_fds,
  
    File &quot;C:\Users\user\anaconda3\lib\subprocess.py&quot;, line 1307, in _execute_child
      hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
  
  FileNotFoundError: [WinError 2] The system cannot find the file specified
  </code></pre>
  <p><strong>The sample code I was trying to run:</strong></p>
  <p>I'm trying to run the below sample source code to generate an image to visualize a binary decision.</p>
  <pre><code>from sklearn.datasets import load_iris
  iris = load_iris()
  
  # Model (can also use single decision tree)
  from sklearn.ensemble import RandomForestClassifier
  model = RandomForestClassifier(n_estimators=10)
  
  # Train
  model.fit(iris.data, iris.target)
  # Extract single tree
  estimator = model.estimators_[5]
  
  from sklearn.tree import export_graphviz
  # Export as dot file
  export_graphviz(estimator, out_file='tree.dot', 
                  feature_names = iris.feature_names,
                  class_names = iris.target_names,
                  rounded = True, proportion = False, 
                  precision = 2, filled = True)
  
  # Convert to png using system command (requires Graphviz)
  from subprocess import call
  call(['dot', '-Tpng', 'tree.dot', '-o', 'tree.png', '-Gdpi=600'])
  #
  # It works if directly call command `dot -Tpng tree.dot -o tree.png -Gdpi=600`
  # but the subprocess call here doesn't work
  #
  
  # Display in jupyter notebook
  from IPython.display import Image
  Image(filename = 'tree.png')
  </code></pre>
  <p><strong>Check python packages in Anaconda Prompt:</strong></p>
  <pre><code>(base) C:\Users\user&gt;conda list graphviz
  # packages in environment at C:\Users\user\anaconda3:
  #
  # Name                    Version                   Build  Channel
  graphviz                  2.38                 hfd603c8_2
  python-graphviz           0.16               pyhd3eb1b0_1
  
  (base) C:\Users\user&gt;where dot
  C:\Users\user\anaconda3\Library\bin\dot.bat
  
  (base) C:\Users\user&gt;
  </code></pre>