Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-681

PyInstaller cannot find QtUiTools because of QtXml

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Invalid
    • Affects Version/s: 5.9
    • Fix Version/s: None
    • Component/s: PySide
    • Labels:

      Description

      Not sure if this is out of scope... but I figured I'd still report it so others can find the workaround.

      When using PyInstaller to freeze a Python script into an .exe file on Windows, this code will yield an error when executing the frozen application:

      from PySide2 import QtUiTools
      

      The error:

      Traceback (most recent call last):
        File "main.py", line 18, in <module>
          from PySide2 import QtUiTools
        File "c:\users\fredrik\code\test\venv\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 714, in load_module
          module = loader.load_module(fullname)
      ImportError: could not import module 'PySide2.QtXml'
      

      Workaround: before importing QtUiTools, first import QtXml.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            crmaurei Cristian Maureira-Fredes
            Reporter:
            fredrikaverpil Fredrik Averpil
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes