title: qt.qpa.xcb: could not connect to displayerror while using OpenCV on ec2 ubuntu server 20.0
body: <p>I am trying to run Tesseract Ocr code as mentioned here
  <a href="https://www.pyimagesearch.com/2018/09/17/opencv-ocr-and-text-recognition-with-tesseract/" rel="nofollow noreferrer">https://www.pyimagesearch.com/2018/09/17/opencv-ocr-and-text-recognition-with-tesseract/</a>
  on ec2 ubuntu server 20.0.</p>
  <p>I am facing an error on:</p>
  <pre><code>cv2.imshow(&quot;Text Detection&quot;, output)
  </code></pre>
  <p>The error is as follows:</p>
  <blockquote>
  <p>qt.qpa.xcb: could not connect to display
  qt.qpa.plugin: Could not load the Qt platform plugin &quot;xcb&quot; in &quot;/usr/local/lib/python3.8/dist-packages/cv2/qt/plugins&quot; even though it was found.
  This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.</p>
  </blockquote>
  <blockquote>
  <p>Available platform plugins are: xcb, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc.</p>
  </blockquote>
  <blockquote>
  <p>Aborted (core dumped)</p>
  </blockquote>
  <p>I know this line of code would open a window to display the image of detected output ,but that window is not showing up.Please help with the error.</p>