HumanFallDetection icon indicating copy to clipboard operation
HumanFallDetection copied to clipboard

qt.qpa.plugin: Could not find the Qt platform plugin "offscreen" in "/root/miniconda3/envs/human/lib/python3.8/site-packages/cv2/qt/plugins"

Open JW-Yuan opened this issue 1 year ago • 1 comments

I got an error about opencv-python-4.10.0.84:

qt.qpa.plugin: Could not find the Qt platform plugin "offscreen" in "/root/miniconda3/envs/human/lib/python3.8/site-packages/cv2/qt/plugins.This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem."

and I tried 3 methods:

  1. pip install opencv-pythonand pip install opencv-python-headless. then the error occurred

cv2.error: OpenCV(4.10.0) /io/opencv/modules/highgui/src/window.cpp:1284: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvNamedWindow'

  1. pip install PyQt5or pip install PyQt6didn't work
  2. remove the folder /root/miniconda3/envs/human/lib/python3.8/site-packages/cv2/qt/plugins didn't work.

JW-Yuan avatar Jul 21 '24 06:07 JW-Yuan

This error will cause all gui-related functions of cv2,like cv2.imshow() and cv2.waitKey() to be unavailable. I don’t know if it’s because of this that ,process1.join() has never been able to end.By the way,I tried lowering the version of opencv-python to 3.4.18.65,it didn't work.

JW-Yuan avatar Jul 21 '24 11:07 JW-Yuan