Issues with QtQuick Controls with on PySide 6
-
I had a project on PySide2, which worked just fine until I decided to install PySide6. After fixing most of the stuff I started getting the very unhelpful error messages:
- The program has unexpectedly finished.
- The process was ended forcefully.
- /Library/Frameworks/Python.framework/Versions/3.9/bin/python3 crashed.
I didn't really see anything wrong with the project, so I created a blank project which worked just fine. However, same messages as above appeared as soon as I added some controls (e.g. button), which I believe to be the source of the issue.
I'm running the following:
- MacOS Big Sur 11.5.2 (latest)
- Python 3.9.6
- PySide 6.1.2
I installed Qt using the online installer with the following options selected:
- Design Tools (Qt Design Studio)
- Qt 6.1 for desktop development (Qt libraries for clang)
Here are some example files:
main.qml
import QtQuick import QtQuick.Window import QtQuick.Layouts import QtQuick.Controls Window { width: 640 height: 480 visible: true title: qsTr("Hello World") RowLayout { id: rowLayout anchors.fill: parent Button { id: btn } } }
import os from pathlib import Path import sys from PySide6.QtGui import QGuiApplication from PySide6.QtQml import QQmlApplicationEngine if __name__ == "__main__": app = QGuiApplication(sys.argv) engine = QQmlApplicationEngine() engine.load(os.fspath(Path(__file__).resolve().parent / "main.qml")) if not engine.rootObjects(): sys.exit(-1) sys.exit(app.exec())
main.pyproject
{ "files": ["main.py", "main.qml"] }
-
-
I believe it might be a Mac related issue. Found the same thing on stack overflow - https://stackoverflow.com/questions/66492343/pyside6-comes-with-segmentation-fault-on-mac
-