“Module ”QtQuick“ version 2.7 is not installed” Error on Raspberry Pi

367
September 11, 2017, at 12:01 PM

I am attempting to develop a GUI for some Python code that I have already written for an insulin pump. I've been using QT Quick as it seems the easiest for a beginner (it doesn't need to be super fancy, it just needs to work). Although the qml script runs fine when I try to run it on my computer, when I attempt to run it on my Raspberry Pi, it returns the error that QtQuick is not installed. I've tried installing all of the relevant dependencies, but that does nothing to clear up the error message. The script I'm using to run it is as follows:

import sys
from PyQt5.QtWidgets import QApplication, QMainWindow
from PyQt5.QtCore import QUrl
from PyQt5.QtQuick import QQuickView

if __name__ == "__main__":
    app = QApplication(sys.argv)
    view = QQuickView()
    view.setSource(QUrl('MainForm.ui.qml'))
    view.show()
    sys.exit(app.exec_())
    app = QApplication(sys.argv)
    view = QQuickView()
    view.setSource(QUrl('MainForm.ui.qml'))
    view.show()
    sys.exit(app.exec_())

My QtQuick code is this.

import QtQuick 2.7
import QtQuick.Controls 2.2
import QtQuick.Extras 1.4
Rectangle {
    property alias mouseArea: mouseArea
    width: 360
    height: 360
    property alias button2: button2
    MouseArea {
        id: mouseArea
        enabled: true
        anchors.rightMargin: 0
        anchors.bottomMargin: 0
        anchors.leftMargin: 0
        anchors.topMargin: 0
        anchors.fill: parent

        Button {
            id: button
            x: 40
            y: 208
            width: 68
            height: 28
            text: qsTr("Basal")
            font.pixelSize: 13
            font.capitalization: Font.Capitalize
            enabled: true
            visible: true
            opacity: 0.5
            spacing: -22
        }
        Button {
            id: button1
            x: 253
            y: 208
            width: 68
            height: 28
            text: qsTr("Bolus")
        }

        Button {
            id: button2
            x: 130
            y: 145
            text: qsTr("Status")
            font.bold: true
            font.pointSize: 20
        }
        Button {
            id: button3
            x: 145
            y: 208
            width: 71
            height: 28
            text: qsTr("Settings")
            autoExclusive: true
        }
        Image {
            id: image
            x: 12
            y: 38
            width: 336
            height: 75
            source: "../Downloads/Pump Logo.jpg"
        }
    }
}

So, what do you think I need to do differently?

Also, after I get this error message worked out, I was wondering: how do you integrate existing Python functions into the QtQuick code? Basically I want to have the user press a button, then the GUI will change to a new window and the specified function will run, with the output being printed to that new screen. My apologies if this is a really dumb question, but I'm a high schooler and no one I know knows how to code. Thank you in advance!

READ ALSO
Python - Send email error connection timeout

Python - Send email error connection timeout

I got this error message when my server trying to send an email to user

507
Django Filtering Search Results using GET

Django Filtering Search Results using GET

I would like to build a filter for my ListView, to further narrow down the search results

268
Trying to parse some json but i am getting a key error - Django

Trying to parse some json but i am getting a key error - Django

I have a request that I am sending to an API and i am getting a json format responseI want to grab items from the response that is being sent back but not getting anything out of it

249
nodejs console.log does not produce a output on Windows inside a funtion

nodejs console.log does not produce a output on Windows inside a funtion

I tried the following code(which is produced by corresponding Typescript code) and played with some solution in previous questions and answersNo luck, nothing is produced by the code inside the Startup() function, but works with the two bottom lines

284