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. How to solve "Could not load the Qt platform plugin "cocoa" in "" even though it was found."
Forum Updated to NodeBB v4.3 + New Features

How to solve "Could not load the Qt platform plugin "cocoa" in "" even though it was found."

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
26 Posts 7 Posters 12.3k 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.
  • hskoglundH Offline
    hskoglundH Offline
    hskoglund
    wrote on last edited by
    #17

    HI, just guessing but maybe your app is picking up the QtDBus dylib from another place outside of your englauncher.app directory (and using relative paths).
    To check, could you launch your app from the dist directory (i.e. where it runs successfully) and then open a Terminal and type
    lsof -c englauncher
    this will show what dlls/dylibs are loaded (and most importantly their paths).

    J 1 Reply Last reply
    0
    • hskoglundH hskoglund

      HI, just guessing but maybe your app is picking up the QtDBus dylib from another place outside of your englauncher.app directory (and using relative paths).
      To check, could you launch your app from the dist directory (i.e. where it runs successfully) and then open a Terminal and type
      lsof -c englauncher
      this will show what dlls/dylibs are loaded (and most importantly their paths).

      J Offline
      J Offline
      JimboNiss
      wrote on last edited by
      #18

      @hskoglund, the process doesn't keep running, so not sure I can run lsof on it.

      Another thing I tried is completely uninstalling python3 from brew repository, and reinstalling it directly from python3, using Mac disk image. Had to reinstall my pip libraries, and got the same exact issue.

      I'm at my wits end with this, and think it's a Big Sur issue, though can't prove it.

      1 Reply Last reply
      0
      • hskoglundH Offline
        hskoglundH Offline
        hskoglund
        wrote on last edited by
        #19

        Hi, one way stop your app from exiting, you could try showing a message box, for example like this:

        ...
        app = QApplication([])
        alert = QMessageBox()
        alert.setText('Click me when lsof -c is done')
        alert.exec()
        ...
        

        then you should have time to do a lsof -c englauncher

        J 1 Reply Last reply
        0
        • hskoglundH hskoglund

          Hi, one way stop your app from exiting, you could try showing a message box, for example like this:

          ...
          app = QApplication([])
          alert = QMessageBox()
          alert.setText('Click me when lsof -c is done')
          alert.exec()
          ...
          

          then you should have time to do a lsof -c englauncher

          J Offline
          J Offline
          JimboNiss
          wrote on last edited by
          #20

          @hskoglund, that didn't help, as it's not even able to load the Qt libraries. I even created a simple test app with your code, and while I can run it from ./dist/testapp, as soon as I copy it to /Applications, it fails loading the libraries in the same way.

          1 Reply Last reply
          0
          • hskoglundH Offline
            hskoglundH Offline
            hskoglund
            wrote on last edited by
            #21

            Ok, please run that simple test app again from /dist/testapp, and while that QMessageBox is displayed, start a Terminal and type
            lsof -c testapp

            1 Reply Last reply
            0
            • L Offline
              L Offline
              leotest
              wrote on last edited by
              #22

              i have the same question,wait answer,please

              1 Reply Last reply
              0
              • L Offline
                L Offline
                leotest
                wrote on last edited by
                #23

                no answer?please help

                1 Reply Last reply
                0
                • hskoglundH Offline
                  hskoglundH Offline
                  hskoglund
                  wrote on last edited by
                  #24

                  Hi, please create a new forum post and describe your problem, what version of Python and MacOS you have etc.

                  L 1 Reply Last reply
                  0
                  • hskoglundH hskoglund

                    Hi, please create a new forum post and describe your problem, what version of Python and MacOS you have etc.

                    L Offline
                    L Offline
                    leotest
                    wrote on last edited by
                    #25

                    @hskoglund ok,thank u

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      mkcol
                      wrote on last edited by
                      #26

                      I fixed this on my machine by requiring py2app version 0.25

                      setup_requires=['py2app==0.25']
                      in the setup.py

                      This problem is described in https://github.com/ronaldoussoren/py2app/issues/380 and there's already a patch. Just don't use 0.26 and 0.27.

                      1 Reply Last reply
                      1

                      • Login

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