Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
Forum Updated to NodeBB v4.3 + New Features

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.

Scheduled Pinned Locked Moved Solved Installation and Deployment
183 Posts 87 Posters 885.8k Views 8 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B beetree

    @coffeesmoke

    As for Debian. The correct library is found as of Debian 11. Which at the moment is in testing.

    • Qt application fails to start on Debian 10 Buster because libqxcb.so requires missing libxcb-util.so.1

    Symlink to a different library version is a possible workaround, but does not guarantee everything else works as expected, and as such ill advised.

    coffeesmokeC Offline
    coffeesmokeC Offline
    coffeesmoke
    wrote on last edited by
    #72

    @beetree I agree. Alternatively , a virtual machine. But if you do not want to install the VM, you need to save the changes in the notations to yourself to be able to return to the original version.

    1 Reply Last reply
    0
    • J Jimit Rupani

      @Advig said in qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.:

      1. export QT_DEBUG_PLUGINS=1

      2. export PATH=$PATH:~/Qt/Tools/QtCreator/bin

      3. libxcb dependency so https://unix.stackexchange.com/questions/338519/how-to-install-libxcb gave the solution.

      sudo apt-get install libxcb-randr0-dev libxcb-xtest0-dev libxcb-xinerama0-dev libxcb-shape0-dev libxcb-xkb-dev

      1. sudo apt-get install libxkbcommon-x11-dev

      solved my problem for ubuntu 20.04. Tried reinstalling almost 3 times before the solution. Hope it helps someone

      A Offline
      A Offline
      Alexreell
      wrote on last edited by
      #73

      @Jimit-Rupani Thank you, the first 2 points on kali linux helped me

      1 Reply Last reply
      0
      • coffeesmokeC coffeesmoke

        So, Debian 10:

        1. ldd -r <for example, home dir>/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so | grep libxcb-util

        libxcb-util.so.1 => not found

        1. Ok, continue...
          sudo find /usr/lib | grep libxcb-util
          ...
          libxcb-util.so.0.0.0
          libxcb-util.so.0.0
          libxcb-util.so.0
          , but need
          libxcb-util.so.1

        2. Ok, Debian... :) Redy?
          sudo ln -fs /usr/lib/x86_64-linux-gnu/libxcb-util.so.0.0.0 /usr/lib/x86_64-linux-gnu/libxcb-util.so.1.0.0
          sudo ln -fs /usr/lib/x86_64-linux-gnu/libxcb-util.so.0.0.0 /usr/lib/x86_64-linux-gnu/libxcb-util.so.1.0
          sudo ln -fs /usr/lib/x86_64-linux-gnu/libxcb-util.so.0.0.0 /usr/lib/x86_64-linux-gnu/libxcb-util.so.1

        QtCreator start complete! :))))

        N Offline
        N Offline
        Niffo
        wrote on last edited by
        #74

        @coffeesmoke Thank you VERY much !

        1 Reply Last reply
        0
        • S Srinivas Reddy

          I am using Qt-5.15.0, got the same problem.
          More details are:
          QLibraryPrivate::loadPlugin failed on "/opt/Qt/5.15.0/gcc_64/plugins/platforms/libqxcb.so" : "Cannot load library /opt/Qt/5.15.0/gcc_64/plugins/platforms/libqxcb.so: (libxcb-xinerama.so.0: cannot open shared object file: No such file or directory)"

          Solved by installing the dependent package.
          Command to install: sudo apt-get install libxcb-xinerama0

          S Offline
          S Offline
          sheril
          wrote on last edited by
          #75

          @Srinivas-Reddy
          Thanks.

          1 Reply Last reply
          0
          • L Lengendary

            Thanks very much!
            I spent several hours trying to solve this problem until I got here.
            sudo apt-get install libxcb-xinerama0
            Thanks!

            R Offline
            R Offline
            requinham
            wrote on last edited by
            #76

            @Lengendary Thanks, this resolve the problem for me on Ubuntu 18.04 Qt 5.15.2

            Regards,
            Mohamed Hamzaoui

            C 1 Reply Last reply
            0
            • R requinham

              @Lengendary Thanks, this resolve the problem for me on Ubuntu 18.04 Qt 5.15.2

              C Offline
              C Offline
              CoreDump
              wrote on last edited by
              #77

              Environment: Ubuntu20.10; Qt 5.15.2, VirtualBox VM:

              The solution provided by @Legendary no longer works, use this instead:

              $ sudo apt-get install libxcb-randr0-dev libxcb-xtest0-dev libxcb-xinerama0-dev libxcb-shape0-dev libxcb-xkb-dev

              1 Reply Last reply
              0
              • coffeesmokeC coffeesmoke

                So, Debian 10:

                1. ldd -r <for example, home dir>/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so | grep libxcb-util

                libxcb-util.so.1 => not found

                1. Ok, continue...
                  sudo find /usr/lib | grep libxcb-util
                  ...
                  libxcb-util.so.0.0.0
                  libxcb-util.so.0.0
                  libxcb-util.so.0
                  , but need
                  libxcb-util.so.1

                2. Ok, Debian... :) Redy?
                  sudo ln -fs /usr/lib/x86_64-linux-gnu/libxcb-util.so.0.0.0 /usr/lib/x86_64-linux-gnu/libxcb-util.so.1.0.0
                  sudo ln -fs /usr/lib/x86_64-linux-gnu/libxcb-util.so.0.0.0 /usr/lib/x86_64-linux-gnu/libxcb-util.so.1.0
                  sudo ln -fs /usr/lib/x86_64-linux-gnu/libxcb-util.so.0.0.0 /usr/lib/x86_64-linux-gnu/libxcb-util.so.1

                QtCreator start complete! :))))

                R Offline
                R Offline
                roboTURx
                wrote on last edited by
                #78

                @coffeesmoke thanks a lot ~ this works for me

                1 Reply Last reply
                0
                • L Lengendary

                  Thanks very much!
                  I spent several hours trying to solve this problem until I got here.
                  sudo apt-get install libxcb-xinerama0
                  Thanks!

                  D Offline
                  D Offline
                  Deep61803
                  wrote on last edited by
                  #79

                  @Lengendary said in qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.:

                  ibxcb-xinerama0

                  Thank you, This solution helped me also.

                  1 Reply Last reply
                  0
                  • T Offline
                    T Offline
                    trimixotun
                    wrote on last edited by trimixotun
                    #80

                    It's looks slightly outdated, but maybe it someone helps:

                    1. Debian 10 x86-64.
                    2. LXDE
                    3. Fresh net install Qt 5.12.10

                    Qtcreator first launch problem: "qt.qpa.plugin: Could not load the Qt platform plugin "xcb"".

                    Nothing from above helps at all. Qtcreator needs libxcb-util.so.1, but system has only libxcb-util.so.

                    Simple solution:

                    sudo ln -s /usr/lib/x86_64-linux-gnu/libxcb-util.so /usr/lib/x86_64-linux-gnu/libxcb-util.so.1

                    All work, folks.

                    W G 2 Replies Last reply
                    1
                    • T trimixotun

                      It's looks slightly outdated, but maybe it someone helps:

                      1. Debian 10 x86-64.
                      2. LXDE
                      3. Fresh net install Qt 5.12.10

                      Qtcreator first launch problem: "qt.qpa.plugin: Could not load the Qt platform plugin "xcb"".

                      Nothing from above helps at all. Qtcreator needs libxcb-util.so.1, but system has only libxcb-util.so.

                      Simple solution:

                      sudo ln -s /usr/lib/x86_64-linux-gnu/libxcb-util.so /usr/lib/x86_64-linux-gnu/libxcb-util.so.1

                      All work, folks.

                      W Offline
                      W Offline
                      wobl
                      wrote on last edited by wobl
                      #81

                      @trimixotun said in qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.:

                      sudo ln -s /usr/lib/x86_64-linux-gnu/libxcb-util.so /usr/lib/x86_64-linux-gnu/libxcb-util.so.1

                      Thanks a lot ... this is working for MX Linux too - but with a little correction:

                      sudo ln -s /usr/lib/x86_64-linux-gnu/libxcb-util.so.0.0.0 /usr/lib/x86_64-linux-gnu/libxcb-util.so.1
                      
                      1 Reply Last reply
                      1
                      • S Srinivas Reddy

                        I am using Qt-5.15.0, got the same problem.
                        More details are:
                        QLibraryPrivate::loadPlugin failed on "/opt/Qt/5.15.0/gcc_64/plugins/platforms/libqxcb.so" : "Cannot load library /opt/Qt/5.15.0/gcc_64/plugins/platforms/libqxcb.so: (libxcb-xinerama.so.0: cannot open shared object file: No such file or directory)"

                        Solved by installing the dependent package.
                        Command to install: sudo apt-get install libxcb-xinerama0

                        N Offline
                        N Offline
                        nileshmoodley
                        wrote on last edited by
                        #82

                        @Srinivas-Reddy Thank you very much - this solved it for me!

                        1 Reply Last reply
                        0
                        • J Offline
                          J Offline
                          Jean-Noel
                          wrote on last edited by Jean-Noel
                          #83

                          For me (on Debian), the only thing that worked was to completely uninstall Qt with Maintenance Tool, and install with "default" configuration.

                          1 Reply Last reply
                          0
                          • A Offline
                            A Offline
                            ajlogo
                            wrote on last edited by
                            #84

                            The plugin problem started when I re-created an Anaconda env (PyQt5 and ubuntu) from a .yml file.
                            https://newini.wordpress.com/2020/08/13/how-to-solve-xcb-plugin-error-in-pyqt5/
                            Had the working answer for me:
                            sudo apt-get install qt5-default # For Ubuntu system

                            1 Reply Last reply
                            0
                            • SGaistS SGaist

                              HI,

                              Did you run ldd on your libraries and libxcb-xinerama versions ?

                              P Offline
                              P Offline
                              pixel_08
                              wrote on last edited by
                              #85

                              @SGaist hi,
                              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.
                              /bin/bash: line 133: 1745 Aborted (core dumped) python csv2txt.py

                              Then I added, export QT_DEBUG_PLUGINS=1
                              got error as,
                              QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/bin/platforms" ...
                              Cannot load library /builds/sravani_detect/video_frames/venv/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so: (libxcb-util.so.1: cannot open shared object file: No such file or directory)
                              QLibraryPrivate::loadPlugin failed on "/builds/sravani_detect/video_frames/venv/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so" : "Cannot load library /builds/sravani_detect/video_frames/venv/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so: (libxcb-util.so.1: cannot open shared object file: No such file or directory)"

                              and ran ldd /builds/sravani_detect/video_frames/venv/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so

                              linux-vdso.so.1 (0x00007ffc728e9000)
                              libQt5XcbQpa.so.5 => /builds/sravani_detect/video_frames/venv/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/../../lib/libQt5XcbQpa.so.5 (0x00007fda88aa2000)
                              libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007fda88a50000)
                              libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007fda88994000)
                              libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fda88776000)
                              libQt5Gui.so.5 => /builds/sravani_detect/video_frames/venv/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/../../lib/libQt5Gui.so.5 (0x00007fda87e45000)
                              libQt5DBus.so.5 => /builds/sravani_detect/video_frames/venv/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/../../lib/libQt5DBus.so.5 (0x00007fda87bb7000)
                              libQt5Core.so.5 => /builds/sravani_detect/video_frames/venv/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/../../lib/libQt5Core.so.5 (0x00007fda873c1000)
                              libGL.so.1 => /usr/lib/x86_64-linux-gnu/libGL.so.1 (0x00007fda8732d000)
                              libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fda8730c000)
                              libX11-xcb.so.1 => /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007fda87307000)
                              libxcb-icccm.so.4 => /usr/lib/x86_64-linux-gnu/libxcb-icccm.so.4 (0x00007fda87300000)
                              libxcb-image.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-image.so.0 (0x00007fda870f9000)
                              libxcb-shm.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007fda870f4000)
                              libxcb-util.so.1 => not found
                              libxcb-keysyms.so.1 => /usr/lib/x86_64-linux-gnu/libxcb-keysyms.so.1 (0x00007fda86ef1000)
                              libxcb-randr.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-randr.so.0 (0x00007fda86edf000)
                              libxcb-render-util.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-render-util.so.0 (0x00007fda86cdb000)
                              libxcb-render.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-render.so.0 (0x00007fda86cca000)
                              libxcb-shape.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-shape.so.0 (0x00007fda86cc5000)
                              libxcb-sync.so.1 => /usr/lib/x86_64-linux-gnu/libxcb-sync.so.1 (0x00007fda86cbb000)
                              libxcb-xfixes.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-xfixes.so.0 (0x00007fda86cb1000)
                              libxcb-xinerama.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-xinerama.so.0 (0x00007fda86cac000)
                              libxcb-xkb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb-xkb.so.1 (0x00007fda86c8e000)
                              libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007fda86c62000)
                              libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007fda86a50000)
                              libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007fda8690f000)
                              libxkbcommon-x11.so.0 => /usr/lib/x86_64-linux-gnu/libxkbcommon-x11.so.0 (0x00007fda86904000)
                              libxkbcommon.so.0 => /usr/lib/x86_64-linux-gnu/libxkbcommon.so.0 (0x00007fda868c2000)
                              libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fda868bd000)
                              libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fda86737000)
                              libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fda865b4000)
                              libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fda8659a000)
                              libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fda863d9000)
                              libxcb-util.so.1 => not found
                              libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007fda863d4000)
                              libglib-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fda862b3000)
                              libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007fda86276000)
                              libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007fda8626d000)
                              libpng16.so.16 => /usr/lib/x86_64-linux-gnu/libpng16.so.16 (0x00007fda86234000)
                              libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007fda861e1000)
                              libicui18n.so.56 => /builds/sravani_detect/video_frames/venv/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/../../lib/libicui18n.so.56 (0x00007fda85d46000)
                              libicuuc.so.56 => /builds/sravani_detect/video_frames/venv/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/../../lib/libicuuc.so.56 (0x00007fda8598e000)
                              libicudata.so.56 => /builds/sravani_detect/video_frames/venv/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/../../lib/libicudata.so.56 (0x00007fda83fab000)
                              /lib64/ld-linux-x86-64.so.2 (0x00007fda89001000)
                              libGLX.so.0 => /usr/lib/x86_64-linux-gnu/libGLX.so.0 (0x00007fda83f77000)
                              libGLdispatch.so.0 => /usr/lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007fda83eba000)
                              libxcb-util.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-util.so.0 (0x00007fda83cb1000)
                              libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007fda83aad000)
                              libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007fda838a7000)
                              libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007fda83833000)
                              libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007fda83790000)
                              libbsd.so.0 => /usr/lib/x86_64-linux-gnu/libbsd.so.0 (0x00007fda83776000)
                              librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fda8376c000)
                              liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007fda83744000)
                              liblz4.so.1 => /usr/lib/x86_64-linux-gnu/liblz4.so.1 (0x00007fda83725000)
                              libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007fda83607000)
                              libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007fda835e2000)

                              what to do next?
                              Thank you!

                              1 Reply Last reply
                              0
                              • SGaistS Offline
                                SGaistS Offline
                                SGaist
                                Lifetime Qt Champion
                                wrote on last edited by
                                #86

                                Install the package that provides "libxcb-util.so.1" on your system.

                                Interested in AI ? www.idiap.ch
                                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                P S 2 Replies Last reply
                                1
                                • SGaistS SGaist

                                  Install the package that provides "libxcb-util.so.1" on your system.

                                  P Offline
                                  P Offline
                                  pixel_08
                                  wrote on last edited by
                                  #87

                                  @SGaist
                                  Thank you, Can we run PyQt5 applications in gitlab by setting up a pipeline?
                                  Please clarify this.

                                  1 Reply Last reply
                                  0
                                  • SGaistS Offline
                                    SGaistS Offline
                                    SGaist
                                    Lifetime Qt Champion
                                    wrote on last edited by
                                    #88

                                    Do you mean run tests on your GUI in GitLab ?

                                    Interested in AI ? www.idiap.ch
                                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                    P 1 Reply Last reply
                                    0
                                    • SGaistS SGaist

                                      Do you mean run tests on your GUI in GitLab ?

                                      P Offline
                                      P Offline
                                      pixel_08
                                      wrote on last edited by
                                      #89

                                      @SGaist yes

                                      1 Reply Last reply
                                      0
                                      • SGaistS Offline
                                        SGaistS Offline
                                        SGaist
                                        Lifetime Qt Champion
                                        wrote on last edited by
                                        #90

                                        Yes you can, you have to use the offscreen backend though unless your runner provides adequate connection to an X server.

                                        Interested in AI ? www.idiap.ch
                                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                        1 Reply Last reply
                                        0
                                        • S Srinivas Reddy

                                          I am using Qt-5.15.0, got the same problem.
                                          More details are:
                                          QLibraryPrivate::loadPlugin failed on "/opt/Qt/5.15.0/gcc_64/plugins/platforms/libqxcb.so" : "Cannot load library /opt/Qt/5.15.0/gcc_64/plugins/platforms/libqxcb.so: (libxcb-xinerama.so.0: cannot open shared object file: No such file or directory)"

                                          Solved by installing the dependent package.
                                          Command to install: sudo apt-get install libxcb-xinerama0

                                          S Offline
                                          S Offline
                                          Srinivas Reddy
                                          wrote on last edited by
                                          #91

                                          @Srinivas-Reddy This worked for me. Thank you.

                                          1 Reply Last reply
                                          0

                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved