Module qtquick is not installed windows

I’m trying to get a basic PyQt5 QML project going using either Windows or Linux. I first tried Linux and with no luck am trying Windows now. My issue is whenever I try and run it via python main.py it will complain that «module «QtQuick» is not installed» and «module «QtQuick.Window» is not installed».

I feel like this is a simple pointing of some path to the QT install location but don’t know where to go from here. Using Qt Widgets works but not QML.

My main.py file is:

import sys

from PyQt5.QtQml import QQmlApplicationEngine
from PyQt5.QtGui import QGuiApplication

def _find_plugins():
    import PyQt5
    from os import path
    paths = [path.abspath(path.join(path.dirname(PyQt5.__file__), 'plugins'))]
    import PyQt5.QtCore
    PyQt5.QtCore.QCoreApplication.setLibraryPaths(paths)

if __name__ == '__main__':
    # _find_plugins()

    app = QGuiApplication(sys.argv)

    engine = QQmlApplicationEngine()

    engine.load('test.qml')

    sys.exit(app.exec_())

and my test.qml file is:

import QtQuick 2.2
import QtQuick.Window 2.1

ApplicationWindow {
    visible: true
    width: 640
    height: 480
    minimumWidth: 400
    minimumHeight: 300
}

asked Jun 15, 2016 at 18:33

egfconnor's user avatar

1

Turns out I needed to add the following Environment Variable:

QML2_IMPORT_PATH

with the value in my case being:

C:\Python35\Lib\site-packages\PyQt5\qml

answered Jun 15, 2016 at 20:25

egfconnor's user avatar

egfconnoregfconnor

2,6371 gold badge26 silver badges44 bronze badges

2

I faced this problem in Linux, and after playing around, I found out that by removing qt and pyqt5 with:

conda remove -c conda-forge pyside2 pyqt 

And installing those package with pip, my problem got solved!
by using pip install pyqt5>=5.11

p.s: I am using: ubuntu 20.04, miniconda, python 3.7, pyqt5>=5.11

answered Jun 17, 2021 at 12:53

Morteza's user avatar

I’m trying to get a basic PyQt5 QML project going using either Windows or Linux. I first tried Linux and with no luck am trying Windows now. My issue is whenever I try and run it via python main.py it will complain that «module «QtQuick» is not installed» and «module «QtQuick.Window» is not installed».

I feel like this is a simple pointing of some path to the QT install location but don’t know where to go from here. Using Qt Widgets works but not QML.

My main.py file is:

import sys

from PyQt5.QtQml import QQmlApplicationEngine
from PyQt5.QtGui import QGuiApplication

def _find_plugins():
    import PyQt5
    from os import path
    paths = [path.abspath(path.join(path.dirname(PyQt5.__file__), 'plugins'))]
    import PyQt5.QtCore
    PyQt5.QtCore.QCoreApplication.setLibraryPaths(paths)

if __name__ == '__main__':
    # _find_plugins()

    app = QGuiApplication(sys.argv)

    engine = QQmlApplicationEngine()

    engine.load('test.qml')

    sys.exit(app.exec_())

and my test.qml file is:

import QtQuick 2.2
import QtQuick.Window 2.1

ApplicationWindow {
    visible: true
    width: 640
    height: 480
    minimumWidth: 400
    minimumHeight: 300
}

asked Jun 15, 2016 at 18:33

egfconnor's user avatar

1

Turns out I needed to add the following Environment Variable:

QML2_IMPORT_PATH

with the value in my case being:

C:\Python35\Lib\site-packages\PyQt5\qml

answered Jun 15, 2016 at 20:25

egfconnor's user avatar

egfconnoregfconnor

2,6371 gold badge26 silver badges44 bronze badges

2

I faced this problem in Linux, and after playing around, I found out that by removing qt and pyqt5 with:

conda remove -c conda-forge pyside2 pyqt 

And installing those package with pip, my problem got solved!
by using pip install pyqt5>=5.11

p.s: I am using: ubuntu 20.04, miniconda, python 3.7, pyqt5>=5.11

answered Jun 17, 2021 at 12:53

Morteza's user avatar

This topic has been deleted. Only users with topic management privileges can see it.

  • I am trying to deploy my application on windows using windeployqt but I get the following errors when trying to run my applicaiton:

    Librum: qrc:/main.qml:4:1: module "QtQuick.Window" is not installed
    Librum: qrc:/main.qml:3:1: module "QtQuick.Layouts" is not installed
    Librum: qrc:/main.qml: module "QtQuick.Controls.Basic" is not installed
    Librum: qrc:/main.qml: module "QtQml.WorkerScript" is not installed
    Librum: qrc:/main.qml:4:1: module "QtQuick.Window" is not installed
    Librum: qrc:/main.qml:3:1: module "QtQuick.Layouts" is not installed
    Librum: qrc:/main.qml: module "QtQuick.Controls.Basic" is not installed
    Librum: qrc:/main.qml: module "QtQml.WorkerScript" is not installed
    Librum: qrc:/main.qml:4:1: module "QtQuick.Window" is not installed
    Librum: qrc:/main.qml:3:1: module "QtQuick.Layouts" is not installed
    Librum: qrc:/main.qml: module "QtQuick.Controls.Basic" is not installed
    Librum: qrc:/main.qml: module "QtQml.WorkerScript" is not installed
    Librum: qrc:/main.qml:4:1: module "QtQuick.Window" is not installed
    Librum: qrc:/main.qml:3:1: module "QtQuick.Layouts" is not installed
    Librum: qrc:/main.qml: module "QtQuick.Controls.Basic" is not installed
    Librum: qrc:/main.qml: module "QtQml.WorkerScript" is not installed
    

    Any idea how I could fix this? There is a «qml» folder in the result of windeployqt but it is empty. Do I need to add anything to it manually?

  • @Creaperdown I think you have to pass -qml parameter to windeploytool to tell it where you QML stuff is.

  • @Creaperdown I think you have to pass -qml parameter to windeploytool to tell it where you QML stuff is.

  • This post is deleted!

  • @jsulm Right, I have seen this before and copied the command windeployqt.exe --qmldir . --release .\librum.exe. Now that you mention it I realized that there is a . as the path for qmldir which is wrong. Where exactly should that point to? Simply to my qml source directory?

  • @Creaperdown said in module «QtQuick.*» is not installed:

    Simply to my qml source directory?

    I think so, yes

  • @jsulm Thank you, this fixes it.


  • Topic has been marked as solved 

    C Creaperdown 

  • Hi,

    A user reported and I confirm:

    $ webcamoid
    QQmlApplicationEngine failed to load component
    qrc:/Webcamoid/share/qml/main.qml:25 module «QtQuick.Layouts» is not installed
    qrc:/Webcamoid/share/qml/main.qml:24 module «QtQuick.Controls» is not installed
    qrc:/Webcamoid/share/qml/main.qml:21 module «QtQuick» is not installed
    qrc:/Webcamoid/share/qml/main.qml:23 module «QtQuick.Window» is not installed
    qrc:/Webcamoid/share/qml/main.qml:25 module «QtQuick.Layouts» is not installed
    qrc:/Webcamoid/share/qml/main.qml:24 module «QtQuick.Controls» is not installed
    qrc:/Webcamoid/share/qml/main.qml:21 module «QtQuick» is not installed
    qrc:/Webcamoid/share/qml/main.qml:23 module «QtQuick.Window» is not installed
    qrc:/Webcamoid/share/qml/main.qml:25 module «QtQuick.Layouts» is not installed
    qrc:/Webcamoid/share/qml/main.qml:24 module «QtQuick.Controls» is not installed
    qrc:/Webcamoid/share/qml/main.qml:21 module «QtQuick» is not installed
    qrc:/Webcamoid/share/qml/main.qml:23 module «QtQuick.Window» is not installed
    qrc:/Webcamoid/share/qml/main.qml:25 module «QtQuick.Layouts» is not installed
    qrc:/Webcamoid/share/qml/main.qml:24 module «QtQuick.Controls» is not installed
    qrc:/Webcamoid/share/qml/main.qml:21 module «QtQuick» is not installed
    qrc:/Webcamoid/share/qml/main.qml:23 module «QtQuick.Window» is not installed

    The user said that he fixed the problem with qml-module-qtquick-dialogs package.
    I installed the package but the errors still happen.

    Webcamoid was builded with qtdeclarative5-dev. (log — i386)
    https://buildd.debian.org/status/fetch.php?pkg=webcamoid&arch=i386&ver=7.0.0-2&stamp=1458754915

    Do you have something in mind ?

    regards,

    4 / 4 / 0

    Регистрация: 27.05.2012

    Сообщений: 120

    1

    16.09.2015, 07:45. Показов 9159. Ответов 6


    Студворк — интернет-сервис помощи студентам

    Вылавливаю такое сообщение и многие другие при попытке подключения qml файла в класс, наследуемый от QQuickWidget.
    В чём может быть проблема?

    authenticationwindow.cpp

    C++ (Qt)
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    
    #include "authenticationwindow.h"
    #include "ui_authenticationwindow.h"
     
    AuthenticationWindow::AuthenticationWindow(QWidget *parent) :
        QQuickWidget(parent)
    {
        connect(this, SIGNAL(statusChanged(QQuickWidget::Status)),
                SLOT(slotCatchQmlErrors(QQuickWidget::Status)));
     
        QUrl source("../data/qml/UserLogin.qml");
        resize(400, 250);
     
        model = nullptr;
        root = nullptr;
        context = nullptr;
     
        setResizeMode(QQuickWidget::SizeRootObjectToView);
        setAttribute(Qt::WA_AlwaysStackOnTop);
        setClearColor(Qt::transparent);
        setWindowFlags(Qt::FramelessWindowHint);
        setSource(source);
     
        root = rootObject();
     
        context = rootContext();
        connect(root, SIGNAL(signalClose()), this, SIGNAL(signalCloseEvent()));
        connect(root, SIGNAL(signalOk(QString, QString, bool)), this,
                SIGNAL(signalOk(QString, QString, bool)));  // 888
        connect(root, SIGNAL(signalPressed()), this, SLOT(slotPressed()));
        connect(root, SIGNAL(signalReleased()), this, SLOT(slotReleased()));
        connect(root, SIGNAL(signalPositionChanged()), this,
                SLOT(slotPositionChanged()));
     
        if (!root)
        {
            qDebug() << "not connected: AuthenticationWindow";
            return;
        }
    }
     
    void AuthenticationWindow::slotCatchQmlErrors(QQuickWidget::Status s)
    {
        if (s == QQuickWidget::Error)
        {
            qDebug() << "QML ERROR!";
            foreach (QQmlError err, errors()) {
                qDebug() << err.toString();
                qDebug() << err.description();
            }
        }
    }
    ...

    authenticationwindow.h

    C++ (Qt)
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    
    #pragma once
     
    #include <QQuickWidget>
    #include <QQuickItem>
    #include <QQmlContext>
    #include <QQmlEngine>
     
    #include "model/usermodel.h"
     
    class AuthenticationWindow : public QQuickWidget
    {
        Q_OBJECT
    public:
        explicit AuthenticationWindow(QWidget *parent = 0);
        ~AuthenticationWindow();
        QPushButton *butRegistration;
        UserModel *model;
        void setModel(UserModel *m);
    public slots:
        void slotReturnPassword();
    private slots:
        void slotOk();
        void slot();
        void slotPressed();
        void slotReleased();
        void slotPositionChanged();
        void slotCatchQmlErrors(QQuickWidget::Status s);
    signals:
        void signalOk(QString us, QString psw, bool b);
        void signalCloseEvent();
    private:
        QPoint difference;
        QString log;
        QString nolog;
        QLabel *lab;
        QLineEdit *lineUser;
        QLineEdit *linePassword;
        QPushButton *butOk;
        void closeEvent(QCloseEvent *event);
        QQuickItem *root;
        QQmlContext *context;
    };

    UserLogin.qml

    JSON
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    
    import QtQuick 2.0
    import QtQuick.Controls 1.3
    import QtQuick.Layouts 1.1
    import QtQuick.Controls.Styles 1.3
     
    Rectangle {
        id: root
        property int length: 24
        property int min: 10
        property string pathClose: "../icon/close.svg"
        property string pathCloseOff: "../icon/close1.svg"
        property string pathCloseOff2: "../icon/close2.svg"
        property string pathGlobexy: "../iconP/1.png"
        property string pathOk: "../icon/down14.svg"
        property string pathOkOff: "../icon/down15.svg"
        property string pathCancel: "../icon/close2.svg"
        property string pathReg: "../icon/reg2.svg"
        property string pathRegOff: "../icon/reg1.svg"
    ...
    }

    Ошибки

    Кликните здесь для просмотра всего текста

    QML ERROR!
    «file:///D:/GlobeXYMain/projects/BaseApplication/data/qml/UserLogin.qml:1:1: module «QtQuick» is not installed»
    «module «QtQuick» is not installed»
    «file:///D:/GlobeXYMain/projects/BaseApplication/data/qml/UserLogin.qml:2:1: module «QtQuick.Controls» is not installed»
    «module «QtQuick.Controls» is not installed»
    «file:///D:/GlobeXYMain/projects/BaseApplication/data/qml/UserLogin.qml:3:1: module «QtQuick.Layouts» is not installed»
    «module «QtQuick.Layouts» is not installed»
    «file:///D:/GlobeXYMain/projects/BaseApplication/data/qml/UserLogin.qml:4:1: module «QtQuick.Controls.Styles» is not installed»
    «module «QtQuick.Controls.Styles» is not installed»
    «file:///D:/GlobeXYMain/projects/BaseApplication/data/qml/UserLogin.qml:1:1: module «QtQuick» is not installed»
    «module «QtQuick» is not installed»
    «file:///D:/GlobeXYMain/projects/BaseApplication/data/qml/UserLogin.qml:2:1: module «QtQuick.Controls» is not installed»
    «module «QtQuick.Controls» is not installed»
    «file:///D:/GlobeXYMain/projects/BaseApplication/data/qml/UserLogin.qml:3:1: module «QtQuick.Layouts» is not installed»
    «module «QtQuick.Layouts» is not installed»
    «file:///D:/GlobeXYMain/projects/BaseApplication/data/qml/UserLogin.qml:4:1: module «QtQuick.Controls.Styles» is not installed»
    «module «QtQuick.Controls.Styles» is not installed»
    «file:///D:/GlobeXYMain/projects/BaseApplication/data/qml/UserLogin.qml:1:1: module «QtQuick» is not installed»
    «module «QtQuick» is not installed»
    «file:///D:/GlobeXYMain/projects/BaseApplication/data/qml/UserLogin.qml:2:1: module «QtQuick.Controls» is not installed»
    «module «QtQuick.Controls» is not installed»
    «file:///D:/GlobeXYMain/projects/BaseApplication/data/qml/UserLogin.qml:3:1: module «QtQuick.Layouts» is not installed»
    «module «QtQuick.Layouts» is not installed»
    «file:///D:/GlobeXYMain/projects/BaseApplication/data/qml/UserLogin.qml:4:1: module «QtQuick.Controls.Styles» is not installed»
    «module «QtQuick.Controls.Styles» is not installed»
    «file:///D:/GlobeXYMain/projects/BaseApplication/data/qml/UserLogin.qml:1:1: module «QtQuick» is not installed»
    «module «QtQuick» is not installed»
    «file:///D:/GlobeXYMain/projects/BaseApplication/data/qml/UserLogin.qml:2:1: module «QtQuick.Controls» is not installed»
    «module «QtQuick.Controls» is not installed»
    «file:///D:/GlobeXYMain/projects/BaseApplication/data/qml/UserLogin.qml:3:1: module «QtQuick.Layouts» is not installed»
    «module «QtQuick.Layouts» is not installed»
    «file:///D:/GlobeXYMain/projects/BaseApplication/data/qml/UserLogin.qml:4:1: module «QtQuick.Controls.Styles» is not installed»
    «module «QtQuick.Controls.Styles» is not installed»
    not connected: AuthenticationWindow

    Добавлено через 7 минут
    P.S.: при подключении этого же класса в пустой проект, такие ощибки не вываливаются

    Добавлено через 7 минут
    P.P.S.: ошибки вываливаются только в дебаге, собственно в этом и проблема — из-за этого не могу нормально дебажиться

    Добавлено через 1 час 18 минут
    P.P.P.S.: ошибки возникают после вызова context = rootContext();



    0



  • Mount and blade warband не запускается на windows 10
  • Ml1250 samsung driver windows 10
  • Moschip semiconductor technology ltd драйвер windows 10
  • Mobile vpn for windows mobile
  • Mount linux usb on windows