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. Error: qt.qpa.xcb: could not connect to display
Forum Updated to NodeBB v4.3 + New Features

Error: qt.qpa.xcb: could not connect to display

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
12 Posts 4 Posters 19.5k Views 2 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.
  • U Offline
    U Offline
    ubuntu712
    wrote on last edited by
    #1

    Hello everyone,

    first off thank you very much for your time. It's my first post to the forum and I hope this is the right place for it. I refrained from posting it in the python directory, as I believe this is related to installation problems. Ülease let me know if I am wrong.

    I am trying to use pyqtgraph under a (ana)conda environment in Ubuntu 18.04LTS on a remote server and have come across the following problem, when I import "import pyqtgraph as pg" and try to launch "pg.mkQApp()"

    QFactoryLoader::QFactoryLoader() checking directory path "/home/mike/anaconda3/envs/CondaEnv/bin/platforms" ...
    loaded library "/home/mike/anaconda3/envs/CondaEnv/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, minimal, minimalegl, offscreen, vnc, webgl, xcb.
    

    As I am not a root user on the server, I then duplicated the conda environment on my local Ubuntu 20.04 LTS machine and tested everything there, where everything works just fine.

    As libxcb is installed and everything is found, I am not sure how to properly debug this. Can anyone help?

    JonBJ 1 Reply Last reply
    0
    • U ubuntu712

      Hello everyone,

      first off thank you very much for your time. It's my first post to the forum and I hope this is the right place for it. I refrained from posting it in the python directory, as I believe this is related to installation problems. Ülease let me know if I am wrong.

      I am trying to use pyqtgraph under a (ana)conda environment in Ubuntu 18.04LTS on a remote server and have come across the following problem, when I import "import pyqtgraph as pg" and try to launch "pg.mkQApp()"

      QFactoryLoader::QFactoryLoader() checking directory path "/home/mike/anaconda3/envs/CondaEnv/bin/platforms" ...
      loaded library "/home/mike/anaconda3/envs/CondaEnv/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, minimal, minimalegl, offscreen, vnc, webgl, xcb.
      

      As I am not a root user on the server, I then duplicated the conda environment on my local Ubuntu 20.04 LTS machine and tested everything there, where everything works just fine.

      As libxcb is installed and everything is found, I am not sure how to properly debug this. Can anyone help?

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @ubuntu712
      Set environment variable export QT_DEBUG_PLUGINS=1 and then run your Python program. Look at the end of the diagnostic output.

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

        Hi and welcome to devnet,

        Do you have any other graphical application that works from that remote server ?

        How do you connect to it ?

        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
        1
        • JonBJ JonB

          @ubuntu712
          Set environment variable export QT_DEBUG_PLUGINS=1 and then run your Python program. Look at the end of the diagnostic output.

          U Offline
          U Offline
          ubuntu712
          wrote on last edited by
          #4

          @SGaist: Thank you! I honestly don't know. Perhaps you could provide an example of some generic application that would be normally installed? I am guessing that the admin tries to keep it as minimalist as possible, but I am not sure.
          I normally connect over SSH; I can utilize jupyter lab when I redirect the port to my localhost;
          but the admin said that an X11 forwarding should work as well.

          @JonB: Thank you, I just tried. Can you help with the interpretation?

          QFactoryLoader::QFactoryLoader() checking directory path "/home/mike/anaconda3/envs/CondaEnv/plugins/platforms" ...
          QFactoryLoader::QFactoryLoader() looking at "/home/mike/anaconda3/envs/CondaEnv/plugins/platforms/libqeglfs.so"
          Found metadata in lib /home/mike/anaconda3/envs/CondaEnv/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 "/home/mike/anaconda3/envs/CondaEnv/plugins/platforms/libqminimal.so"
          Found metadata in lib /home/mike/anaconda3/envs/CondaEnv/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 "/home/mike/anaconda3/envs/CondaEnv/plugins/platforms/libqminimalegl.so"
          Found metadata in lib /home/mike/anaconda3/envs/CondaEnv/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 "/home/mike/anaconda3/envs/CondaEnv/plugins/platforms/libqoffscreen.so"
          Found metadata in lib /home/mike/anaconda3/envs/CondaEnv/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 "/home/mike/anaconda3/envs/CondaEnv/plugins/platforms/libqvnc.so"
          Found metadata in lib /home/mike/anaconda3/envs/CondaEnv/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 "/home/mike/anaconda3/envs/CondaEnv/plugins/platforms/libqwebgl.so"
          Found metadata in lib /home/mike/anaconda3/envs/CondaEnv/plugins/platforms/libqwebgl.so, metadata=
          {
              "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
              "MetaData": {
                  "Keys": [
                      "webgl"
                  ]
              },
              "archreq": 0,
              "className": "QWebGLIntegrationPlugin",
              "debug": false,
              "version": 330752
          }
          
          
          Got keys from plugin meta data ("webgl")
          QFactoryLoader::QFactoryLoader() looking at "/home/mike/anaconda3/envs/CondaEnv/plugins/platforms/libqxcb.so"
          Found metadata in lib /home/mike/anaconda3/envs/CondaEnv/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")
          QFactoryLoader::QFactoryLoader() checking directory path "/home/mike/anaconda3/envs/CondaEnv/bin/platforms" ...
          loaded library "/home/mike/anaconda3/envs/CondaEnv/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, minimal, minimalegl, offscreen, vnc, webgl, xcb.
          
          Aborted (core dumped)
          
          
          JonBJ 1 Reply Last reply
          0
          • U ubuntu712

            @SGaist: Thank you! I honestly don't know. Perhaps you could provide an example of some generic application that would be normally installed? I am guessing that the admin tries to keep it as minimalist as possible, but I am not sure.
            I normally connect over SSH; I can utilize jupyter lab when I redirect the port to my localhost;
            but the admin said that an X11 forwarding should work as well.

            @JonB: Thank you, I just tried. Can you help with the interpretation?

            QFactoryLoader::QFactoryLoader() checking directory path "/home/mike/anaconda3/envs/CondaEnv/plugins/platforms" ...
            QFactoryLoader::QFactoryLoader() looking at "/home/mike/anaconda3/envs/CondaEnv/plugins/platforms/libqeglfs.so"
            Found metadata in lib /home/mike/anaconda3/envs/CondaEnv/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 "/home/mike/anaconda3/envs/CondaEnv/plugins/platforms/libqminimal.so"
            Found metadata in lib /home/mike/anaconda3/envs/CondaEnv/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 "/home/mike/anaconda3/envs/CondaEnv/plugins/platforms/libqminimalegl.so"
            Found metadata in lib /home/mike/anaconda3/envs/CondaEnv/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 "/home/mike/anaconda3/envs/CondaEnv/plugins/platforms/libqoffscreen.so"
            Found metadata in lib /home/mike/anaconda3/envs/CondaEnv/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 "/home/mike/anaconda3/envs/CondaEnv/plugins/platforms/libqvnc.so"
            Found metadata in lib /home/mike/anaconda3/envs/CondaEnv/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 "/home/mike/anaconda3/envs/CondaEnv/plugins/platforms/libqwebgl.so"
            Found metadata in lib /home/mike/anaconda3/envs/CondaEnv/plugins/platforms/libqwebgl.so, metadata=
            {
                "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
                "MetaData": {
                    "Keys": [
                        "webgl"
                    ]
                },
                "archreq": 0,
                "className": "QWebGLIntegrationPlugin",
                "debug": false,
                "version": 330752
            }
            
            
            Got keys from plugin meta data ("webgl")
            QFactoryLoader::QFactoryLoader() looking at "/home/mike/anaconda3/envs/CondaEnv/plugins/platforms/libqxcb.so"
            Found metadata in lib /home/mike/anaconda3/envs/CondaEnv/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")
            QFactoryLoader::QFactoryLoader() checking directory path "/home/mike/anaconda3/envs/CondaEnv/bin/platforms" ...
            loaded library "/home/mike/anaconda3/envs/CondaEnv/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, minimal, minimalegl, offscreen, vnc, webgl, xcb.
            
            Aborted (core dumped)
            
            
            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by
            #5

            @ubuntu712 said in Error: qt.qpa.xcb: could not connect to display:

            qt.qpa.xcb: could not connect to display

            I know that this is the problem! I did not notice this was in your original post. People like @SGaist know more then I do and I'm sure they will help. It's something about your remote server, X11 display stuff :)

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

              How are you currently connecting to your remote machine ?

              Jupiter lab does sadly does not help as it is a server setup that you access through your web browser.

              As for testing, your admin is likely more knowledgeable on what is installed on that remote machine.

              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
              • U Offline
                U Offline
                ubuntu712
                wrote on last edited by
                #7

                I am currently connecting via ssh on a terminal. I've tried a bunch, I currently do not know of any graphical user interface that is installed.

                What would be next step I could test from my side? The admin is quite busy I think; I can submit packages for installation, but it would be good if I could do most of the testing. Furthermore, I would like to learn what I am doing wrong, in case I have to setup the toolchain on another server any time soon :)

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

                  What exact line do you use with ssh to connect to that machine ?

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

                  U 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    What exact line do you use with ssh to connect to that machine ?

                    U Offline
                    U Offline
                    ubuntu712
                    wrote on last edited by
                    #9

                    @SGaist in a ubuntu terminal I use: ssh user@ipadress (after connecting over a vpn)

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

                      Unless you have an ssh config that sets some parameters when you connect to that remote, you are at least missing the -X parameter. X11 forwarding is not on by default.

                      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
                      2
                      • U Offline
                        U Offline
                        ubuntu712
                        wrote on last edited by
                        #11

                        Oh thank you so much, that did the trick for me. Learned a lot today! Thank you again for your patience, in the end this turned out to be completely unrelated to qt!

                        Pablo J. RoginaP 1 Reply Last reply
                        0
                        • U ubuntu712

                          Oh thank you so much, that did the trick for me. Learned a lot today! Thank you again for your patience, in the end this turned out to be completely unrelated to qt!

                          Pablo J. RoginaP Offline
                          Pablo J. RoginaP Offline
                          Pablo J. Rogina
                          wrote on last edited by
                          #12

                          @ubuntu712 said in Error: qt.qpa.xcb: could not connect to display:

                          that did the trick for me

                          great! so please don't forget to mark your post as solved then.

                          Upvote the answer(s) that helped you solve the issue
                          Use "Topic Tools" button to mark your post as Solved
                          Add screenshots via postimage.org
                          Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                          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