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
Qt 6.11 is out! See what's new in the release blog

Error in exe file

Scheduled Pinned Locked Moved Unsolved Qt for Python
3 Posts 3 Posters 736 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 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]

    jsulmJ JonBJ 2 Replies Last reply
    0
    • M Mahdi_2020

      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]

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on 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

        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]

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on 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

        • Login

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