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. QtQuick Python+Anaconda: "main.qml:1 module "QtQuick" version 2.14 is not installed"
Forum Updated to NodeBB v4.3 + New Features

QtQuick Python+Anaconda: "main.qml:1 module "QtQuick" version 2.14 is not installed"

Scheduled Pinned Locked Moved Solved General and Desktop
9 Posts 2 Posters 1.4k Views 1 Watching
  • 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.
  • D Offline
    D Offline
    Developer123
    wrote on last edited by
    #1

    I'm trying to run a QtQuick application using python and Anaconda manager in a CMD terminal (Windows):

    python main.py
    

    but I get the error:

    file:///C:/Users/user/Documents/code/QT/QtQuickPy/main.qml:1 module "QtQuick" version 2.14 is not installed
    

    I have Python 3.7 with PySlide2 and PyQT installed. I tried setting up the environment variables for QT:

    Path=...; C:\Qt\Tools\mingw900_64\bin
    QTDIR=C:\Qt\6.2.2\mingw_64
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Why are you pointing your environment that use PySide2 which uses Qt 5 to your Qt 6 installation ?

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

      D 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        Why are you pointing your environment that use PySide2 which uses Qt 5 to your Qt 6 installation ?

        D Offline
        D Offline
        Developer123
        wrote on last edited by
        #3

        @SGaist Yeah good point, didn't notice that. But in any case, I tried installing Qt5 (in addition to the initial Qt6 install). So supposedly I have now both.

        However, when I create a Python Project, there is no option to choose which Qt version I want (as opposed to Cpp Project, where such option appears). So I thought maybe it didn't matter. In any case I will try to change that variable...

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

          Do you actually have PySide2 installed ?
          If so, how ?

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

          D 1 Reply Last reply
          0
          • SGaistS SGaist

            Do you actually have PySide2 installed ?
            If so, how ?

            D Offline
            D Offline
            Developer123
            wrote on last edited by
            #5

            @SGaist Yes, I installed using conda install -c conda-forge pyside2 , and it installed pyside2-5.13.2.

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

              Without your environment variable manipulation, are you able to start your script ?

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

              D 1 Reply Last reply
              0
              • SGaistS SGaist

                Without your environment variable manipulation, are you able to start your script ?

                D Offline
                D Offline
                Developer123
                wrote on last edited by Developer123
                #7

                @SGaist Not at all
                Just an update, I added the following environment variables:

                QTDIR=C:\Qt\5.15.2
                QML_IMPORT_PATH=C:\Qt\5.15.2\mingw81_64\qml
                QML2_IMPORT_PATH=C:\Qt\5.15.2\mingw81_64\qml
                

                And now I'm getting a new error, which is more promising:

                QQmlApplicationEngine failed to load component
                file:///C:/Users/User/OneDrive/Documents/code/QT-Projects/QtQuickPy/main.qml:1 plugin cannot be loaded for module "QtQuick": The plugin 'C:/Qt/5.15.2/mingw81_64/qml/QtQuick.2/qtquick2plugin.dll' uses incompatible Qt library. (5.15.0) [release]
                

                I suppose now I just need to find the correct version permutation of Python+Pyside+PyQT+Qt+Qt Quick.

                Do you have any idea if there is a table about this somewhere?

                For the record, my current config is:

                Python 3.7 (from anaconda environment)
                  - pyside2 5.13.2
                  - qt  5.12.9 (was installed automatically with `conda install pyside2`)
                QT 5.15.1 (from C:\Qt\5.15.1)
                QT Quick 2.14 (from the qml file)
                

                (I'm guessing the issue is QT 5.15.1 and Python Qt 5.12.9 yeah? Even though the error mentions incorrect QtQuick version...)

                1 Reply Last reply
                0
                • D Offline
                  D Offline
                  Developer123
                  wrote on last edited by
                  #8

                  Ok, I solved the problem, it was incompatibility between QtQuick version and the installed Pyside2 version.

                  I got it to work without setting up environment variables by using Python 3.8 and Pyside 5.15 (and QtQuick 2.14).

                  Changing the QtQuick version to something like 2.1 caused the first set up with the earlier version of Pyside to work as well.

                  It's a bit confusing because nowhere is explained which version of Pyside2 is compatible with which version of QtQuick... There is a table here from the docs, but it doesn't mention Pyside

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

                    PySide2 releases follow the Qt 5 releases.

                    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
                    1

                    • Login

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