DEV Community

Cover image for Facing error with OpenCV in Ubuntu?
Ankit Sahu
Ankit Sahu

Posted on

Facing error with OpenCV in Ubuntu?

cv2.error: OpenCV(3.4.2) /tmp/build/80754af9/opencv-suite_1535558553474/work/modules/highgui/src/window.cpp:632: error: (-2:Unspecified error) Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvShowImage'.

Is this what you got as error ?

To solve this problem

Install cmake

sudo snap install cmake --classic
Enter fullscreen mode Exit fullscreen mode

Still facing the problem ?
Try installing

sudo apt install libgtk2.0-dev
sudo apt install pkg-config
sudo apt install libopencv-*
Enter fullscreen mode Exit fullscreen mode

Error
QObject::moveToThread: Current thread (0x5618076ecfe0) is not the object's thread (0x561807941d80). Cannot move to target thread (0x5618076ecfe0)

If you are using anaconda then try installing pyqt

conda install pyqt
Enter fullscreen mode Exit fullscreen mode

I hope it helped you :)

Top comments (0)