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

Cannot run hello world QML application because Qt6QuickControls2Basic.dll is missing

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • 6.7.0, 6.6.3.1, 6.8.0
    • 6.6.3
    • PySide
    • None
    • Windows
    • bb819c535 (dev), eea21d0fe (6.7), 35097fc6c (6.6.3.1), 0952bc197 (6.6), bac78374a (tqtc/6.6.3.1), dfcc0786d (dev), 4059cb15a (master)

    Description

      Using a hello world example (together with Python 3.9 or 3.12) like below

      main.py:

      import sys
      
      from PySide6.QtGui import QGuiApplication
      from PySide6.QtQml import QQmlApplicationEngine
      
      app = QGuiApplication(sys.argv)
      
      engine = QQmlApplicationEngine()
      engine.quit.connect(app.quit)
      engine.load('main.qml')
      
      sys.exit(app.exec())
      

      main.qml:

      import QtQuick 2.15
      import QtQuick.Controls 2.15
      
      ApplicationWindow {
          visible: true
          width: 600
          height: 500
          title: "HelloApp"
      
          Text {
              anchors.centerIn: parent
              text: "Hello World"
              font.pixelSize: 24
          }
      
      }
      

      Steps:

      1. pip install Pyside6==6.6.3
      2. python main.py

      Result:

      > python main.py
      QQmlApplicationEngine failed to load component
      file:///C:/Users/User/hello/main.qml:2:1: module "QtQuick.Controls" version 6.6 cannot be imported because:
      module "QtQuick.Controls.Windows" version 6.6 cannot be imported because:
      Cannot load library C:\Users\User\hello\hello\lib\site-packages\PySide6\qml\QtQuick\Controls\Basic\qtquickcontrols2basicstyleplugin.dll: The specified module could not be found.

      Debugging with loader snaps reveals that it cannot load that dll because it cannot find Qt6QuickControls2Basic.dll. Searching through the PySide6 folder in site-packages seems to confirm that this dll is in fact not there.

      Attachments

        Issue Links

          For Gerrit Dashboard: PYSIDE-2655
          # Subject Branch Project Status CR V

          Activity

            People

              kleint Friedemann Kleint
              albert_c Albert Cervin
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: