qt.qpa.plugin: Could not find the Qt platform plugin "offscreen" in "/root/miniconda3/envs/human/lib/python3.8/site-packages/cv2/qt/plugins"
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:
-
pip install opencv-pythonandpip 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'
-
pip install PyQt5orpip install PyQt6didn't work - remove the folder
/root/miniconda3/envs/human/lib/python3.8/site-packages/cv2/qt/pluginsdidn't work.
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.