Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. LSOpenURLsWithRole() failed with error -10810 for the file /Users/gb/myapp/dist/MyApplication.app.

LSOpenURLsWithRole() failed with error -10810 for the file /Users/gb/myapp/dist/MyApplication.app.

Scheduled Pinned Locked Moved Unsolved Qt for Python
2 Posts 2 Posters 300 Views
  • 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.
  • C Offline
    C Offline
    CentreFF
    wrote on last edited by
    #1

    Hi,

    Environment:
    Python 3.8
    Pyqt5
    Mac OS X Catalina

    I am trying to compile my python program in Mac OS application. I get this error message when I open the app:
    (base) gb@MacBookGB % open dist/MyApplication.app
    LSOpenURLsWithRole() failed with error -10810 for the file /Users/gb/myapp/dist/MyApplication.app.

    So I searched everywhere on the web to find solution but none worked.
    As I know Qt5 can make issue when compiling, I made a search and found your article:
    [https://doc.qt.io/qtforpython/deployment-pyinstaller.html](link url)

    I decide to compile your python code shown in this article.

    import sys
    import random
    from PySide2.QtWidgets import (QApplication, QLabel, QPushButton,
                                   QVBoxLayout, QWidget)
    from PySide2.QtCore import Slot, Qt
    
    class MyWidget(QWidget):
        def __init__(self):
            QWidget.__init__(self)
    
            self.hello = ["Hallo Welt", "你好,世界", "Hei maailma",
                "Hola Mundo", "Привет мир"]
    
            self.button = QPushButton("Click me!")
            self.text = QLabel("Hello World")
            self.text.setAlignment(Qt.AlignCenter)
    
            self.layout = QVBoxLayout()
            self.layout.addWidget(self.text)
            self.layout.addWidget(self.button)
            self.setLayout(self.layout)
    
            # Connecting the signal
            self.button.clicked.connect(self.magic)
    
        @Slot()
        def magic(self):
            self.text.setText(random.choice(self.hello))
    
    if __name__ == "__main__":
        app = QApplication(sys.argv)
    
        widget = MyWidget()
        widget.resize(800, 600)
        widget.show()
    
        sys.exit(app.exec_())
    

    Then I run the command:

    pyinstaller --name="MyApplication" --windowed MyApp.py
    

    And I get exact same issue :

    LSOpenURLsWithRole() failed with error -10810 for the file /Users/gb/myapp/dist/MyApplication.app.
    

    I wonder if some people from your community already faced this issue and found a solution?

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

      Hi,

      How did you install PySide2 ?

      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

      • Login

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