Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Can't get going with QML, Python and QT Creator on Mac OS
Forum Update on Monday, May 27th 2025

Can't get going with QML, Python and QT Creator on Mac OS

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 2 Posters 904 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.
  • jandymanJ Offline
    jandymanJ Offline
    jandyman
    wrote on last edited by jandyman
    #1

    I'm having a bear of a time getting going with Python QML development on Mac OS. So first I got everything working under Windows, figured out how to set up and point to the appropriately set up Python environment, and eventually I was able to just press the run button in Qt Creator and there it is, the QML hello world template for Python pops up a Window. Fantastic.

    So now I go to Mac OS and do the exact same thing. When I press the run button, I get the red exclamation point and the message

    "No device configuration set". 
    

    I have no idea what that means.

    So I tried running from a Terminal window. There I get the message.

    main.qml:1 module "QtQuick" version 2.13 is not installed
    

    So I go to the Maintenance tool for Qt Creator and make sure to install that version of QtQuick for MacOS. But it makes no difference - I still get the error.

    What do these two error messages mean?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #5

      Which version of PySide2 do you have ?
      Which version of Qt Creator do you use ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      jandymanJ 1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #2

        Hi,

        Can you explain how you setup your development environment on macOS ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        jandymanJ 1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          Can you explain how you setup your development environment on macOS ?

          jandymanJ Offline
          jandymanJ Offline
          jandyman
          wrote on last edited by jandyman
          #3

          @SGaist

          I set up a virtual environment using Anaconda, making sure that Pyside2 is installed correctly. I set the Python option in the preferences of QT Creator to point to that virtual environment. I created a new project from the Python QML "Qt for Python - QtQuick Application" template.

          That's all I had to do on Windows, once I got the virtual environment set up properly. I was able to then press the run button and the app window popped up.

          Not so on Mac OS. There is so much "under the hood" stuff for both QT and QT creator, I don't even know where to start understanding these error messages.

          I did install QtQuick for Mac OS explicitly (I didn't have to do this for Windows), but it didn't help with the second error message.

          1 Reply Last reply
          0
          • jandymanJ Offline
            jandymanJ Offline
            jandyman
            wrote on last edited by jandyman
            #4

            @SGaist
            I figured out what was causing the second problem. The version of QtQuick called out in the qml file was presumably newer than the version of QtQuick installed with Pyside 2. That's my guess. I don't know how I should have known this, the QML python tutorials and explanations are very short on "how this works". At any rate, changing the import statements to use an earlier version of QtQuick (2.0) solves the problem. And I still don't know how to know what version of QtQuick is installed with Pyside2.

            I still don't know why I can't run from within Qt Creator or what "No Device Configuration Set" means or how to fix it, or why it doesn't happen with the Windows version of QT creator. No amount of googling seems to help with this.

            Very frustrating.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #5

              Which version of PySide2 do you have ?
              Which version of Qt Creator do you use ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              jandymanJ 1 Reply Last reply
              0
              • SGaistS SGaist

                Which version of PySide2 do you have ?
                Which version of Qt Creator do you use ?

                jandymanJ Offline
                jandymanJ Offline
                jandyman
                wrote on last edited by
                #6

                @SGaist

                I found the problem. For some reason the default run configuration was set up for ARM on the Mac version. God knows why this was the default, it is a giant pothole for a newbie to fall into. Maybe it is because I have ARM dev tools on my machine for embedded work (which has no UI).

                The clue was that the error about the device not being set up also showed a little alarm box in the corner that said "deploy". So I thought WTH am I trying to "deploy"? I opened up the Windows version of QT creator since it worked, and started comparing the build and run settings. It became apparent pretty quick what was wrong, and a few more minutes to convince QT Creator to change to a Desktop "Kit", at which point I could also set the Conda environment.

                All's well that ends well. Now I just need to figure out the mental models to use for getting Python to interact with QML, including button handling, TextEdit update and validation, etc. Maybe there are examples for this, I can hope. So far the tutorials are thin.

                1 Reply Last reply
                1
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #7

                  AFAIK, you can reuse the same concepts that are used for C++ with some language adaptation.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  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