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. pyside6-uic File is not valid error
Qt 6.11 is out! See what's new in the release blog

pyside6-uic File is not valid error

Scheduled Pinned Locked Moved Unsolved Qt for Python
6 Posts 3 Posters 4.0k 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.
  • I Offline
    I Offline
    Improv Jester
    wrote on last edited by
    #1

    I'm getting a failure with pyside6-uic saying the file is not valid. I have two ui files in my project and ones compiles just fine. It is however only 10kb in size. The one giving me the error is 153kb. It opens without issues in Designer and works fine using QUiLoader.
    I run from within the virtual environment. I am using pyside 6.6.2.

    The exact error reads:
    File 'myfile.ui' is not valid

    Is there anything I can try to check the integrity of the XML or maybe steps I can take to isolate the problem?

    JonBJ CristianMaureiraC 2 Replies Last reply
    0
    • I Improv Jester

      I'm getting a failure with pyside6-uic saying the file is not valid. I have two ui files in my project and ones compiles just fine. It is however only 10kb in size. The one giving me the error is 153kb. It opens without issues in Designer and works fine using QUiLoader.
      I run from within the virtual environment. I am using pyside 6.6.2.

      The exact error reads:
      File 'myfile.ui' is not valid

      Is there anything I can try to check the integrity of the XML or maybe steps I can take to isolate the problem?

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

      @Improv-Jester
      You could try reading it with some XML validating tool to check for syntax.

      However, I would suspect that the XML syntax is legal but it contains something the uic does not like. If you are really lucky you could try running pyside6-uic on it yourself in a terminal, leave output to stdout instead of file, and be able to see the code generated as it reads the file, so you would know how far it gets. However, it's quite possible that does not produce any output until the whole file has been read and parsed, in which case it won't help.

      Other than that, the only obvious way is to start "binary chopping" the .ui file contents. That means, you remove about half of it, obviously in a suitable place leaving valid XML. If that run through OK you repeat process; if it errors you restore the removed stuff and chop that again. Till you find the problem.

      1 Reply Last reply
      1
      • I Improv Jester

        I'm getting a failure with pyside6-uic saying the file is not valid. I have two ui files in my project and ones compiles just fine. It is however only 10kb in size. The one giving me the error is 153kb. It opens without issues in Designer and works fine using QUiLoader.
        I run from within the virtual environment. I am using pyside 6.6.2.

        The exact error reads:
        File 'myfile.ui' is not valid

        Is there anything I can try to check the integrity of the XML or maybe steps I can take to isolate the problem?

        CristianMaureiraC Offline
        CristianMaureiraC Offline
        CristianMaureira
        wrote on last edited by
        #3

        @Improv-Jester you can also share one of the .ui files, or a snippet from it that doesn't work in order to check it out.

        JonBJ I 2 Replies Last reply
        0
        • CristianMaureiraC CristianMaureira

          @Improv-Jester you can also share one of the .ui files, or a snippet from it that doesn't work in order to check it out.

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

          @CristianMaureira I think the problem is that OP has a "blob" of 153K and does not know where it it is getting to before it goes wrong! And I think 153K of text is a lot to post here :)

          I 1 Reply Last reply
          0
          • JonBJ JonB

            @CristianMaureira I think the problem is that OP has a "blob" of 153K and does not know where it it is getting to before it goes wrong! And I think 153K of text is a lot to post here :)

            I Offline
            I Offline
            Improv Jester
            wrote on last edited by
            #5

            @JonB In the midst of this I had to rebuild the virtual environment. Running it in a terminal was a great idea. The problems seems to have gone away. I'm guessing while rebuilding I picked up a late Pyside6 lib version.

            Thanks for taking the time to give me ideas.

            1 Reply Last reply
            0
            • CristianMaureiraC CristianMaureira

              @Improv-Jester you can also share one of the .ui files, or a snippet from it that doesn't work in order to check it out.

              I Offline
              I Offline
              Improv Jester
              wrote on last edited by
              #6

              @CristianMaureira Thanks for taking the time to suggest a next step. The problem seems to have gone after I was forced to rebuild my venv.

              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