python app - xcb plugin fail

2019-08-08 15:16发布

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.

3条回答
三岁会撩人
2楼-- · 2019-08-08 15:54
### pip uninstall matplotlib
### pip install matplotlib

This works for me!

查看更多
一纸荒年 Trace。
3楼-- · 2019-08-08 16:05

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

查看更多
beautiful°
4楼-- · 2019-08-08 16:09

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)

查看更多
登录 后发表回答