3

I got the following error while using Google Colab:

qt.qpa.xcb: could not connect to display qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/usr/local/lib/python3.7/site-packages/cv2/qt/plugins" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Available platform plugins are: xcb.

Please help me find a replacement for qt?

Zahra Heydari
  • 55
  • 1
  • 4
  • You should change the title of your question to provide more insights. For example `How Qt platform plugin could be initialized in Google Colab?` could be a good candidate. Also you should include the minimal python code you run in Google Colab that leads to this error. – david Feb 04 '22 at 21:09

2 Answers2

3

Having the same problem, and I think I found the answer. Basically not possible to run QT on the cloud!

"QT is a GUI library that can run only on your local machine. You cannot run it in the cloud and then let it open a QT window on your machine. You may need to find another labeling library that use web-interface instead."

check this out:

Could not connect to any X display: Google Colab Run-time

r3z8
  • 47
  • 6
  • 2
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – Viktor Ivliiev Mar 12 '22 at 19:21
  • 1
    Noted and edited, will definitely consider in the my next contributes, thank you. – r3z8 Mar 12 '22 at 22:37
1

Actually you could make it work with the right platform plugin. By passing for example -platform vnc to your application you should be able to start it in "headless mode". (actually your GUI is drawn to a VNC server you can connect to)

Your error is caused by the absence of a window manager, the xcb platform is trying to access.

Baumflaum
  • 749
  • 7
  • 20
  • Hello, could you please elaborate to your answer. I have a similar problem with GoogleColab. thank you. – Ada Aug 10 '22 at 09:21
  • Just run `yourApplication.exe -platform vnc`. If that does not work post your error message here. Just to be clear, it has to be a Qt application. – Baumflaum Aug 10 '22 at 09:33
  • this is the command i want to run. !python3 /content/4DMOS/semantic-kitti-api/visualize_mos.py -platform vnc And here is the error WARNING: could not connect to display WARNING: Could not load the Qt platform plugin "xcb" in "" even though it was found. WARNING: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb. – Ada Aug 10 '22 at 10:18
  • 1
    You need to research how to select the plugin in python. The keywords for your search: pyQt, platform plugin, qt platform plugin. Im only programming for C++. – Baumflaum Aug 10 '22 at 10:40