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
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
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
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
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
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
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) | ||
|
authenticationwindow.h
C++ (Qt) | ||
|
UserLogin.qml
JSON | ||
|
Ошибки
Кликните здесь для просмотра всего текста
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