1

My setting: Python 2.7 with anaconda

Recently I have installed OpenCV 3.0 and when I try to do simple image display or I want to run python samples that come with OpenCV, there is a error message:

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

I have read many comments that I need to attach .so files to my project but I don't think it's the optimal solution since for most people it works out of a box.

I have no clue what to do. I'm inexperienced. What comes to my mind is only to reinstall everything.

talonmies
  • 70,661
  • 34
  • 192
  • 269
  • Oh, I just read that if I want to use Qt5 I should NOT use cmake flag -D WITH_QT=ON. reference: http://rodrigoberriel.com/2014/10/installing-opencv-3-0-0-on-ubuntu-14-04/ can someon approve and explain why is that? –  May 27 '15 at 13:49

2 Answers2

3

Qt5 works fine with OpenCV 3.1.0. This is what worked for me for resolving the "xcb" error.

Apparently the Anaconda qt and pyqt packages (v4) were shadowing the system v5 version.

If you want to work with Qt5 try removing these via:

conda remove qt
conda remove pyqt

(Ubuntu 16.04, OpenCV 3.1.0, Anaconda 4.1.1, Qt 5)

Community
  • 1
  • 1
gevang
  • 4,994
  • 25
  • 33
2

Okey, I have figured it out.

During cmake I set flag -D WITH_QT=OFF since I read somewhere that it doesnt work for Qt5.x

Pavel Smirnov
  • 4,611
  • 3
  • 18
  • 28