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. Error in exe file
QtWS25 Last Chance

Error in exe file

Scheduled Pinned Locked Moved Unsolved Qt for Python
3 Posts 3 Posters 197 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.
  • M Offline
    M Offline
    Mahdi_2020
    wrote on 25 Nov 2024, 07:00 last edited by
    #1

    When I run my program exe file, I encounter this error, while in Qt Creator the program runs correctly.
    Traceback (most recent call last):
    File "main.py", line 338, in <module>
    IndexError: list index out of range

    line338: root_object = engine.rootObjects()[0]

    J J 2 Replies Last reply 25 Nov 2024, 08:31
    0
    • M Mahdi_2020
      25 Nov 2024, 07:00

      When I run my program exe file, I encounter this error, while in Qt Creator the program runs correctly.
      Traceback (most recent call last):
      File "main.py", line 338, in <module>
      IndexError: list index out of range

      line338: root_object = engine.rootObjects()[0]

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 25 Nov 2024, 08:31 last edited by
      #2

      @Mahdi_2020 said in Error in exe file:

      line338: root_object = engine.rootObjects()[0]

      Who should know what this code does?
      Please provide more details/code...

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • M Mahdi_2020
        25 Nov 2024, 07:00

        When I run my program exe file, I encounter this error, while in Qt Creator the program runs correctly.
        Traceback (most recent call last):
        File "main.py", line 338, in <module>
        IndexError: list index out of range

        line338: root_object = engine.rootObjects()[0]

        J Offline
        J Offline
        JonB
        wrote on 25 Nov 2024, 10:25 last edited by
        #3

        @Mahdi_2020 said in Error in exe file:

        IndexError: list index out of range

        line338: root_object = engine.rootObjects()[0]

        engine.rootObjects() is not an array or, more likely, is an empty array so [0] is out of range.
        If it works under Creator but not outside then presumably creating the engine/objects fails outside because something is not set up right in the environment.

        When I run my program exe file

        When using Python you do not have an executable file, just a bunch of .py file scripts.

        1 Reply Last reply
        0

        1/3

        25 Nov 2024, 07:00

        • Login

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