Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

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



  • Hi there,

    I installed PyQt5==5.15.1 and PyQt5-sip==12.8.1, but I cannot run my project.
    I using WSL Ubuntu in Windows10. I spent some days looking for the answer, but nothing worked. Any suggestions?

    After I run the command:

    export QT_DEBUG_PLUGINS=1

    Result:

    QFactoryLoader::QFactoryLoader() checking directory path "/home/brenot/.local/lib/python3.8/site-packages/PyQt5/Qt/plugins/platforms" ...
    QFactoryLoader::QFactoryLoader() looking at "/home/brenot/.local/lib/python3.8/site-packages/PyQt5/Qt/plugins/platforms/libqeglfs.so"
    Found metadata in lib /home/brenot/.local/lib/python3.8/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": 331520
    }

    Got keys from plugin meta data ("eglfs")
    QFactoryLoader::QFactoryLoader() looking at "/home/brenot/.local/lib/python3.8/site-packages/PyQt5/Qt/plugins/platforms/libqlinuxfb.so"
    Found metadata in lib /home/brenot/.local/lib/python3.8/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": 331520
    }

    Got keys from plugin meta data ("linuxfb")
    QFactoryLoader::QFactoryLoader() looking at "/home/brenot/.local/lib/python3.8/site-packages/PyQt5/Qt/plugins/platforms/libqminimal.so"
    Found metadata in lib /home/brenot/.local/lib/python3.8/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": 331520
    }

    Got keys from plugin meta data ("minimal")
    QFactoryLoader::QFactoryLoader() looking at "/home/brenot/.local/lib/python3.8/site-packages/PyQt5/Qt/plugins/platforms/libqminimalegl.so"
    Found metadata in lib /home/brenot/.local/lib/python3.8/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": 331520
    }

    Got keys from plugin meta data ("minimalegl")
    QFactoryLoader::QFactoryLoader() looking at "/home/brenot/.local/lib/python3.8/site-packages/PyQt5/Qt/plugins/platforms/libqoffscreen.so"
    Found metadata in lib /home/brenot/.local/lib/python3.8/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": 331520
    }

    Got keys from plugin meta data ("offscreen")
    QFactoryLoader::QFactoryLoader() looking at "/home/brenot/.local/lib/python3.8/site-packages/PyQt5/Qt/plugins/platforms/libqvnc.so"
    Found metadata in lib /home/brenot/.local/lib/python3.8/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": 331520
    }

    Got keys from plugin meta data ("vnc")
    QFactoryLoader::QFactoryLoader() looking at "/home/brenot/.local/lib/python3.8/site-packages/PyQt5/Qt/plugins/platforms/libqwayland-egl.so"
    Found metadata in lib /home/brenot/.local/lib/python3.8/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": 331520
    }

    Got keys from plugin meta data ("wayland-egl")
    QFactoryLoader::QFactoryLoader() looking at "/home/brenot/.local/lib/python3.8/site-packages/PyQt5/Qt/plugins/platforms/libqwayland-generic.so"
    Found metadata in lib /home/brenot/.local/lib/python3.8/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": 331520
    }

    Got keys from plugin meta data ("wayland")
    QFactoryLoader::QFactoryLoader() looking at "/home/brenot/.local/lib/python3.8/site-packages/PyQt5/Qt/plugins/platforms/libqwayland-xcomposite-egl.so"
    Found metadata in lib /home/brenot/.local/lib/python3.8/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": 331520
    }

    Got keys from plugin meta data ("wayland-xcomposite-egl")
    QFactoryLoader::QFactoryLoader() looking at "/home/brenot/.local/lib/python3.8/site-packages/PyQt5/Qt/plugins/platforms/libqwayland-xcomposite-glx.so"
    Found metadata in lib /home/brenot/.local/lib/python3.8/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": 331520
    }

    Got keys from plugin meta data ("wayland-xcomposite-glx")
    QFactoryLoader::QFactoryLoader() looking at "/home/brenot/.local/lib/python3.8/site-packages/PyQt5/Qt/plugins/platforms/libqwebgl.so"
    Found metadata in lib /home/brenot/.local/lib/python3.8/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": 331520
    }

    Got keys from plugin meta data ("webgl")
    QFactoryLoader::QFactoryLoader() looking at "/home/brenot/.local/lib/python3.8/site-packages/PyQt5/Qt/plugins/platforms/libqxcb.so"
    Found metadata in lib /home/brenot/.local/lib/python3.8/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": 331520
    }

    Got keys from plugin meta data ("xcb")
    QFactoryLoader::QFactoryLoader() checking directory path "/usr/bin/platforms" ...
    QFactoryLoader::QFactoryLoader() looking at "/usr/bin/platforms/libqeglfs.so"
    Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqeglfs.so, metadata=
    {
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
    "Keys": [
    "eglfs"
    ]
    },
    "archreq": 0,
    "className": "QEglFSIntegrationPlugin",
    "debug": false,
    "version": 330752
    }

    Got keys from plugin meta data ("eglfs")
    QFactoryLoader::QFactoryLoader() looking at "/usr/bin/platforms/libqlinuxfb.so"
    Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqlinuxfb.so, metadata=
    {
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
    "Keys": [
    "linuxfb"
    ]
    },
    "archreq": 0,
    "className": "QLinuxFbIntegrationPlugin",
    "debug": false,
    "version": 330752
    }

    Got keys from plugin meta data ("linuxfb")
    QFactoryLoader::QFactoryLoader() looking at "/usr/bin/platforms/libqminimal.so"
    Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqminimal.so, metadata=
    {
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
    "Keys": [
    "minimal"
    ]
    },
    "archreq": 0,
    "className": "QMinimalIntegrationPlugin",
    "debug": false,
    "version": 330752
    }

    Got keys from plugin meta data ("minimal")
    QFactoryLoader::QFactoryLoader() looking at "/usr/bin/platforms/libqminimalegl.so"
    Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqminimalegl.so, metadata=
    {
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
    "Keys": [
    "minimalegl"
    ]
    },
    "archreq": 0,
    "className": "QMinimalEglIntegrationPlugin",
    "debug": false,
    "version": 330752
    }

    Got keys from plugin meta data ("minimalegl")
    QFactoryLoader::QFactoryLoader() looking at "/usr/bin/platforms/libqoffscreen.so"
    Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqoffscreen.so, metadata=
    {
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
    "Keys": [
    "offscreen"
    ]
    },
    "archreq": 0,
    "className": "QOffscreenIntegrationPlugin",
    "debug": false,
    "version": 330752
    }

    Got keys from plugin meta data ("offscreen")
    QFactoryLoader::QFactoryLoader() looking at "/usr/bin/platforms/libqvnc.so"
    Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqvnc.so, metadata=
    {
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
    "Keys": [
    "vnc"
    ]
    },
    "archreq": 0,
    "className": "QVncIntegrationPlugin",
    "debug": false,
    "version": 330752
    }

    Got keys from plugin meta data ("vnc")
    QFactoryLoader::QFactoryLoader() looking at "/usr/bin/platforms/libqxcb.so"
    Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so, metadata=
    {
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
    "Keys": [
    "xcb"
    ]
    },
    "archreq": 0,
    "className": "QXcbIntegrationPlugin",
    "debug": false,
    "version": 330752
    }

    Got keys from plugin meta data ("xcb")
    loaded library "/home/brenot/.local/lib/python3.8/site-packages/PyQt5/Qt/plugins/platforms/libqxcb.so"
    qt.qpa.xcb: could not connect to display
    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.

    [1] 13106 abort (core dumped) python3 main.py -ai0 template__agent.py -ai1 ./seega/random_agent.py -s 1.5 -


  • Lifetime Qt Champion

    Hi and welcome to the forums

    WSL

    is that version 1 or version 2 ?

    As far As I understand version 2 is better with graphical apps.

    https://virtualizationreview.com/articles/2018/01/30/hands-on-with-wsl-graphical-apps.aspx
    https://www.microsoft.com/en-us/p/gwsl/9nl6kd1h33v3?activetab=pivot:overviewtab

    https://www.qtdesktopdays.com/use-the-windows-subsystem-for-linux-to-develop-your-qt-apps-on-windows/

    version 1 requires some setup to run gfx apps. (like Qt apps is)


Log in to reply