[SOLVED] Could not load the Qt platform plugin "xcb" in "" even though it was found

Hi there,

I have installed RDP with the install script, but it fails to start.

When starting the application from the command line, it fails with the following error:

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" 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: eglfs, linuxfb, minimal, minimalegl, offscreen, 
vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.

My system:

  • Xubuntu 18.04 LTS
  • Remote login via TightVNC server and Remmina
  • python3.6
  • python3 install.py

python3 -m pip show rapid-photo-downloader:

~$ python3 -m pip show rapid-photo-downloader
Name: rapid-photo-downloader
Version: 0.9.23
Summary: Downloads, renames and backs up photos and videos from cameras, phones, memory cards and other devices
Home-page: http://www.damonlynch.net/rapid
Author: Damon Lynch
Author-email: damonlynch@gmail.com
License: GPL 3+
Location: /home/george/.local/lib/python3.6/site-packages
Requires: arrow, easygui, psutil, pymediainfo, rawkit, sortedcontainers, PyQt5, babel, pyxdg, colour, python-dateutil, PyGObject, pyzmq, tornado, gphoto2
Required-by:

ls ~/.local/lib/python3.6/site-packages/:

~$ ls ~/.local/lib/python3.6/site-packages/
total 1076
drwxr-xr-x 3 george george   4096 Apr 20 21:17 cffi
drwxr-xr-x 2 george george   4096 Apr 20 21:17 cffi-1.14.0.dist-info
-rwxr-xr-x 1 george george 853800 Apr 20 21:17 _cffi_backend.cpython-36m-x86_64-linux-gnu.so
drwxr-xr-x 2 george george   4096 Apr 20 21:17 colour-0.1.5.dist-info
-rw-r--r-- 1 george george  28693 Apr 20 21:17 colour.py
-rw-r--r-- 1 george george    126 Apr 20 21:16 easy_install.py
drwxr-xr-x 3 george george   4096 Apr 20 21:17 gphoto2
drwxr-xr-x 2 george george   4096 Apr 20 21:17 gphoto2-2.2.2.dist-info
-rwxr-xr-x 1 george george  80560 Apr 20 21:17 _libheif_cffi.abi3.so
drwxr-xr-x 3 george george   4096 Apr 20 21:17 libraw
drwxr-xr-x 5 george george   4096 Apr 20 21:16 pip
drwxr-xr-x 2 george george   4096 Apr 20 21:16 pip-20.0.2.dist-info
drwxr-xr-x 5 george george   4096 Apr 20 21:16 pkg_resources
drwxr-xr-x 2 george george   4096 Apr 20 21:17 __pycache__
drwxr-xr-x 4 george george   4096 Apr 20 21:17 pycparser
drwxr-xr-x 2 george george   4096 Apr 20 21:17 pycparser-2.20.dist-info
drwxr-xr-x 3 george george   4096 Apr 20 21:17 pyheif
drwxr-xr-x 2 george george   4096 Apr 20 21:17 pyheif-0.4.dist-info
drwxr-xr-x 3 george george   4096 Apr 20 21:17 pymediainfo
drwxr-xr-x 2 george george   4096 Apr 20 21:17 pymediainfo-4.1.dist-info
drwxr-xr-x 3 george george   4096 Apr 20 21:17 pyprind
drwxr-xr-x 2 george george   4096 Apr 20 21:17 PyPrind-2.11.2.dist-info
drwxr-xr-x 6 george george   4096 Apr 20 21:17 PyQt5
drwxr-xr-x 2 george george   4096 Apr 20 21:17 PyQt5-5.14.2.dist-info
drwxr-xr-x 2 george george   4096 Apr 20 21:17 PyQt5_sip-12.7.2.dist-info
drwxr-xr-x 3 george george   4096 Apr 20 21:27 raphodo
drwxr-xr-x 2 george george   4096 Apr 20 21:27 rapid_photo_downloader-0.9.23.dist-info
drwxr-xr-x 3 george george   4096 Apr 20 21:17 rawkit
drwxr-xr-x 2 george george   4096 Apr 20 21:17 rawkit-0.6.0.dist-info
drwxr-xr-x 6 george george   4096 Apr 20 21:16 setuptools
drwxr-xr-x 2 george george   4096 Apr 20 21:16 setuptools-46.1.3.dist-info
drwxr-xr-x 3 george george   4096 Apr 20 21:17 tenacity
drwxr-xr-x 2 george george   4096 Apr 20 21:17 tenacity-6.1.0.dist-info
drwxr-xr-x 4 george george   4096 Apr 20 21:16 wheel
drwxr-xr-x 2 george george   4096 Apr 20 21:16 wheel-0.34.2.dist-info

I could not find an RPD folder under the ~/.cache/.

So (after some google searching) I tried to enable the debug messages for the plugins with exporting QT_DEBUG_PLUGINS=1

Here is the output when I try to start the application:
QT_DEBUG_PLUGINS=1

~$ export QT_DEBUG_PLUGINS=1
~$ rapid-photo-downloader

QFactoryLoader::QFactoryLoader() checking directory path "/home/george/.local/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "/home/george/.local/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/libqeglfs.so"
Found metadata in lib /home/george/.local/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/libqeglfs.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "eglfs"
        ]
    },
    "archreq": 0,
    "className": "QEglFSIntegrationPlugin",
    "debug": false,
    "version": 331264
}


Got keys from plugin meta data ("eglfs")
QFactoryLoader::QFactoryLoader() looking at "/home/george/.local/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/libqlinuxfb.so"
Found metadata in lib /home/george/.local/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/libqlinuxfb.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "linuxfb"
        ]
    },
    "archreq": 0,
    "className": "QLinuxFbIntegrationPlugin",
    "debug": false,
    "version": 331264
}


Got keys from plugin meta data ("linuxfb")
QFactoryLoader::QFactoryLoader() looking at "/home/george/.local/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/libqminimal.so"
Found metadata in lib /home/george/.local/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/libqminimal.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "minimal"
        ]
    },
    "archreq": 0,
    "className": "QMinimalIntegrationPlugin",
    "debug": false,
    "version": 331264
}


Got keys from plugin meta data ("minimal")
QFactoryLoader::QFactoryLoader() looking at "/home/george/.local/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/libqminimalegl.so"
Found metadata in lib /home/george/.local/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/libqminimalegl.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "minimalegl"
        ]
    },
    "archreq": 0,
    "className": "QMinimalEglIntegrationPlugin",
    "debug": false,
    "version": 331264
}


Got keys from plugin meta data ("minimalegl")
QFactoryLoader::QFactoryLoader() looking at "/home/george/.local/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/libqoffscreen.so"
Found metadata in lib /home/george/.local/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/libqoffscreen.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "offscreen"
        ]
    },
    "archreq": 0,
    "className": "QOffscreenIntegrationPlugin",
    "debug": false,
    "version": 331264
}


Got keys from plugin meta data ("offscreen")
QFactoryLoader::QFactoryLoader() looking at "/home/george/.local/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/libqvnc.so"
Found metadata in lib /home/george/.local/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/libqvnc.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "vnc"
        ]
    },
    "archreq": 0,
    "className": "QVncIntegrationPlugin",
    "debug": false,
    "version": 331264
}


Got keys from plugin meta data ("vnc")
QFactoryLoader::QFactoryLoader() looking at "/home/george/.local/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/libqwayland-egl.so"
Found metadata in lib /home/george/.local/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/libqwayland-egl.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "wayland-egl"
        ]
    },
    "archreq": 0,
    "className": "QWaylandEglPlatformIntegrationPlugin",
    "debug": false,
    "version": 331264
}


Got keys from plugin meta data ("wayland-egl")
QFactoryLoader::QFactoryLoader() looking at "/home/george/.local/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/libqwayland-generic.so"
Found metadata in lib /home/george/.local/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/libqwayland-generic.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "wayland"
        ]
    },
    "archreq": 0,
    "className": "QWaylandIntegrationPlugin",
    "debug": false,
    "version": 331264
}


Got keys from plugin meta data ("wayland")
QFactoryLoader::QFactoryLoader() looking at "/home/george/.local/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/libqwayland-xcomposite-egl.so"
Found metadata in lib /home/george/.local/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/libqwayland-xcomposite-egl.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "wayland-xcomposite-egl"
        ]
    },
    "archreq": 0,
    "className": "QWaylandXCompositeEglPlatformIntegrationPlugin",
    "debug": false,
    "version": 331264
}


Got keys from plugin meta data ("wayland-xcomposite-egl")
QFactoryLoader::QFactoryLoader() looking at "/home/george/.local/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/libqwayland-xcomposite-glx.so"
Found metadata in lib /home/george/.local/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/libqwayland-xcomposite-glx.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "wayland-xcomposite-glx"
        ]
    },
    "archreq": 0,
    "className": "QWaylandXCompositeGlxPlatformIntegrationPlugin",
    "debug": false,
    "version": 331264
}


Got keys from plugin meta data ("wayland-xcomposite-glx")
QFactoryLoader::QFactoryLoader() looking at "/home/george/.local/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/libqwebgl.so"
Found metadata in lib /home/george/.local/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/libqwebgl.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "webgl"
        ]
    },
    "archreq": 0,
    "className": "QWebGLIntegrationPlugin",
    "debug": false,
    "version": 331264
}


Got keys from plugin meta data ("webgl")
QFactoryLoader::QFactoryLoader() looking at "/home/george/.local/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/libqxcb.so"
Found metadata in lib /home/george/.local/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/libqxcb.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "xcb"
        ]
    },
    "archreq": 0,
    "className": "QXcbIntegrationPlugin",
    "debug": false,
    "version": 331264
}


Got keys from plugin meta data ("xcb")
QFactoryLoader::QFactoryLoader() checking directory path "/usr/bin/platforms" ...
Cannot load library /home/george/.local/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/libqxcb.so: (libxkbcommon-x11.so.0: cannot open shared object file: No such file or directory)
QLibraryPrivate::loadPlugin failed on "/home/george/.local/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/libqxcb.so" : "Cannot load library /home/george/.local/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/libqxcb.so: (libxkbcommon-x11.so.0: cannot open shared object file: No such file or directory)"
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" 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: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.

Fatal Python error: Aborted

Current thread 0x00007f53cd2c5740 (most recent call first):
  File "/home/george/.local/lib/python3.6/site-packages/raphodo/viewutils.py", line 378 in any_screen_scaled_qt
  File "/home/george/.local/lib/python3.6/site-packages/raphodo/viewutils.py", line 394 in any_screen_scaled
  File "/home/george/.local/lib/python3.6/site-packages/raphodo/rapid.py", line 6400 in main
  File "/home/george/.local/bin/rapid-photo-downloader", line 8 in <module>
Aborted (core dumped)

Any advice on how to fix this?

Welcome @arkroan!

So you can start X11 applications locally and only RPD fails?

libxkbcommon-x11 is missing. What happens if you install it (sudo apt-get install libxkbcommon-x11-0)?

HTH,
Flössie

1 Like

Hi @floessie ,

Thanks for your suggestion. This is what was actually missing.
Doing a sudo apt install libxkbcommon-x11-0 fixed the problem.

To answer your question, yes, I am using VNC or SSH -X to start X11 applications remotely and everything else was working fine.
Now RPD also works!

Best Regards,

1 Like

Thanks @floessie. I’ve added that package to the install script.

1 Like