title: `pydot` failed to call GraphViz.Please install GraphViz and ensure that its executables are in the $PATH
body: <p><a href="https://cloud.google.com/deep-learning-vm/" rel="noreferrer">My jupyter server is running in a gcp deep learning vm.</a></p>
  
  <p>I'm trying to print the model in a Jupyter notebook cell.</p>
  
  <pre><code>import os, sys
  from utils.models.alexnet import alexnet
  from keras.utils.vis_utils import plot_model
  from keras.optimizers import SGD
  
  model = alexnet(len(class_names))
  model.summary()
  plot_model(model, to_file="alexnet_model.png", show_shapes=True)
  </code></pre>
  
  <p>I get this error</p>
  
  <pre><code>`pydot` failed to call GraphViz.Please install GraphViz ([https://www.graphviz.org/](https://www.graphviz.org/)) and ensure that its executables are in the $PATH.
  </code></pre>
  
  <p>I have correctly installed Graphviz in my machine with</p>
  
  <p><code>apt-get install graphviz</code></p>
  
  <pre><code>stat /usr/bin/dot
    File: /usr/bin/dot
    Size: 10568       Blocks: 24         IO Block: 4096   regular file
  Device: 801h/2049d  Inode: 142872      Links: 1
  Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
  Access: 2020-02-10 11:48:19.416617639 +0000
  Modify: 2017-02-19 10:32:17.000000000 +0000
  Change: 2019-12-13 01:47:41.084977709 +0000
  </code></pre>
  
  <p>The python packages pydot, pydot-ng, pydotplus are also installed.</p>
  
  <p>This is my path variable</p>
  
  <pre><code>echo $PATH
  /usr/local/cuda/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
  </code></pre>
  
  <p><code>/user/bin</code> is included here.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>When executed in a jupyter notebook shell.</p>
  
  <pre><code>print(os.environ["PATH"])
  </code></pre>
  
  <p><code>/usr/local/cuda/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games</code></p>
  
  <p><strong>Another wierd thing</strong></p>
  
  <p>I have a simple image dataset with 3 classes and altogether around 2000 images. In my jupyter notebook I first process and load the images into memory. Creating the model and printing it comes next. With the simple dataset it works without error. This happens when I work with large datasets. </p>