title: Gtk-WARNING **: cannot open display:
body: <p>I am using Data science toolbox running ubuntu 14.04 through vagrant in windows.
  I installed OpenCV and tried a very simple python code.</p>
  
  <pre><code>import cv2
  import numpy as np 
  import matplotlib.pyplot as plt 
  
  img = cv2.imread('image1.jpg' , cv2.IMREAD_GRAYSCALE) 
  cv2.imshow('image' , img)
  cv2.waitKey(0)
  cv2.destroyAllwindows()
  </code></pre>
  
  <p>When i run this code i get an error -</p>
  
  <pre><code>(image:1267): Gtk-WARNING **: cannot open display:
  </code></pre>
  
  <p>I have searched on internet but not able to find a solution working for me.</p>
  
  <p>I have tried - </p>
  
  <pre><code>export DISPLAY=:0.0
  export DISPLAY=:0
  </code></pre>
  
  <p>and many more.
  I have also tried xhost +localhost but this gives another error</p>
  
  <pre><code>xhost:  unable to open display ""
  </code></pre>
  
  <p>Anyone know a way to solve this problem.</p>