On my Windows 10 machine I'm trying few simple examples of new Qt6 and QML based example doesn't work for me.
I'm running Python 3.8.6 and a virtual env
python3 -m venv venv
.\venv\Scripts\Activate.ps1
The pyside6 installs without any warnings into the venv
pip install pyside6
and a non-QML hello world example using QApplication and QLabel runs fine (this one: https://doc.qt.io/qtforpython/tutorials/basictutorial/widgets.html )
What doesn't work is this example, taken from https://doc.qt.io/qtforpython/tutorials/basictutorial/qml.html :
main.py:
from PySide6.QtWidgets import QApplication
from PySide6.QtQuick import QQuickView
from PySide6.QtCore import QUrl
app = QApplication([])
view = QQuickView()
url = QUrl("view.qml")
view.setSource(url)
view.show()
app.exec_()
view.qml:
import QtQuick 2.0
Rectangle {
width: 200
height: 200
color: "green"
Text {
text: "Hello World"
anchors.centerIn: parent
}
}
the messages I receive trying to run are:
file:///C:/github/aorcl/python-gui-2/view.qml:1:1: Cannot load library C:\github\aorcl\python-gui-2\venv\lib\site-packages\PySide6\qml\QtQml\WorkerScript\workerscriptplugin.dll: The specified module could not be found.
import QtQuick
^
file:///C:/github/aorcl/python-gui-2/view.qml: Failed to load dependencies for module "QtQml" version 6.0
file:///C:/github/aorcl/python-gui-2/view.qml: Failed to load dependencies for module "QtQuick" version 6.0
I verified and the file isn't missing, it is there:
C:\github\aorcl\python-gui-2\venv\lib\site-packages\PySide6\qml\QtQml\WorkerScript\workerscriptplugin.dll
What else am I missing?