highgui related issues of OpenCV-Python on Ubuntu 14.04

OpenCV-Python always crashed when I used highgui related functions. With Spyder, we can see only kernel crash, so I had no idea what happened. When I ran a problem from terminal, I got an error message that This application failed to start because it could not find or load the Qt platform plugin “xcb”. Googling so many things, I finally found out the solution. The problem was caused by Qt. OpenCV compilation used Qt5 while Anaconda installed Qt4. So, the solution is

conda remove qt
conda remove pyqt
conda install -c https://conda.anaconda.org/mmcauliffe pyqt5
conda install pyside
conda remove qt

The reason why I remove qt twice is installing pyside that is required for Spyder installes Qt4 again. Spyder actually requires PyQt4.X or PySide. I noticed that PySide can work even with Qt5.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s