solved: Could not load the Qt platform plugin "xcb" #300
-
| 
         I will leave here solution for a problem that I could not fix for days, hope it would help someone: I was trying hard, but could not fix it. I was downloading literally hundreds of different packages, over and over again, trying all sorts of "hacks" found online, eventually trying anaconda, a massive download...  | 
  
Beta Was this translation helpful? Give feedback.
Replies: 31 comments 139 replies
-
| 
         Hi there, thanks for reporting. This seems to have been a problem with the   | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         Not sure exactly why, but this made it work for me! original error was `qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/usr/local/lib/python3.9/dist-packages/opencv_python-4.5.5.64-py3.9-linux-x86_64.egg/cv2/qt/plugins" even though it was found. Available platform plugins are: xcb, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc.` I agree this should be added to the Q&A, even if its a dependency and not instant-ngp that is causing trouble  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         I ran into this issue, it seems to be from open-cv opencv/opencv-python#46. Using open-cv-python-headless instead seems to work for me: https://stackoverflow.com/a/72090539  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         Hi, were you using a virtual environment for installing python packages? I was facing the exact same problem and 30 mins later I realized my virtual environment was not activated.  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         I am trying to run rstudio in a conda environment on an institutional server and I am getting the following error:  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         To solve this just run: sudo apt-get install libxcb-xinerama0  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         https://stackoverflow.com/a/68058308/9033534 - first answer 
  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev this work for me , i use qt in docker  | 
  
Beta Was this translation helpful? Give feedback.
-
        
 I ran across this thread trying to diagnose the same issue trying to run Agisoft Metashape on a GPU-equipped-but-headless server. Exporting that environment variable fixed it.  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         My solutions I've tested on my code. If you get Could not load the Qt platform plugin "xcb"after import   | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         In my case it was conflict in Qt installation on the system with the Qt that is shipped with OpenCV. Solved on Ubuntu 22.04 Desktop by removing opencv-python:  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         My problem: I use the command: works for me...  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         Thanks for solution!   | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         I found this answer that showed how to narrow down and locate the problem very helpful. In my case, installing the specific missing libraries AND reinstalling PyQt5 solved the problem.  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         No error appears through   | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         It works for me after installing opencv-contrib-python-headless  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         您的邮件已收到!祝工作顺利! 
     | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         
  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         
 Worked for me  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         I got this error when loading a QT6 program that didn't ship the required QT6 plugins. In particular, obs under rockchip repository for aarch64. Instead, the plugin package installed was a QT5 one, so essentially it wouldn't find any DDE plugins. apt-get install qt6-qpa-pluginswill install the   | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         1.7.9 qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/smart-daq/anaconda3/lib/python3.9/site-packages/cv2/qt/plugins" even though it was found. Available platform plugins are: xcb, eglfs, minimal, minimalegl, offscreen, vnc, webgl. Aborted (core dumped) i am getting this error and after trying all the aformentioned methods it is still not working. does anyone have any ideas  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         Thanks for posting this!   | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         This worked for me. sudo apt-get install libx11-xcb1 libxcb1 libxcb-glx0 \
libxcb-keysyms1 libxcb-image0 libxcb-shm0 libxcb-icccm4 \
libxcb-sync1 libxcb-xfixes0 libxcb-shape0 libxcb-randr0 \
libxcb-render-util0 libxcb-render0 libxcb-xinerama0 libxcb-xkb1 libxkbcommon-x11-0 | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         When I tried these solutions on windows 10 while using a container the code compiled but did not output the visual. The fix I found was installing Xming here: https://sourceforge.net/projects/xming/ and using this line: docker run -e DISPLAY=host.docker.internal:0.0 your-qt-app to run the container.  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         
  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         sudo apt-get remove libxcb-xinerama0 This works for me. Hope this helps someone.  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         
  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         I fixed it by   | 
  
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
| 
         Under Ubuntu 24.04 (on headless server) this one helped (to pipe through ssh to laptop):  | 
  
Beta Was this translation helpful? Give feedback.




























I ran into this issue, it seems to be from open-cv opencv/opencv-python#46.
Using open-cv-python-headless instead seems to work for me: https://stackoverflow.com/a/72090539