0

I want to use OpenCV with python on spyder.
But error occured when I run a simple code.

import cv2
img = cv2.imread('pi.png',0)
cv2.imshow('image', img)
cv2.waitKey(0)
dcv2.destroyAllwindows()

Error

This application failed to start because it could not find or load the Qt platform plugin "xcb".

Reinstalling the application may fix this problem.

The error is occured at this line.

cv2.imshow('image', img)

Details: Ubuntu 14.04(LTS), OpenCV 2.4.13, Spyder 2.3.9(Python 2.7)

Please Tell me in detail what should I do.

Community
  • 1
  • 1
Taewoo Lee
  • 495
  • 5
  • 11

1 Answers1

0

I didn't understand the answer.( stackoverflow.com/questions/30483753/python-app-xcb-plugin-fail )

But, the problem is solved from changing condition when I reinstall OpenCV

Installation is referred to this page.

The key of the solution in this method is simple!

Change the condition from 'WITH_QT=ON' to 'WITH_QT=OFF' in the script. (opencv.sh)

I don't have any solution without reinstalling because I'm inexperienced.

If you know about solution that change the condition without reintalling or reason why the problem is occured, give me a feedback please.

Thank you.

Community
  • 1
  • 1
Taewoo Lee
  • 495
  • 5
  • 11