pyside6-deploy Failed unexpectedly in Scons C backend compilation ????
Unsolved
Qt for Python
-
I have been working with pyside6 and qml. but unfortunately I can't deploy the application. I have started a new project but the error continues. Does anyone know how to fix it?:
main.pyimport sys from PySide6.QtCore import QCoreApplication from PySide6.QtGui import QGuiApplication from PySide6.QtQml import QQmlApplicationEngine if __name__ == "__main__": #creating the app app = QGuiApplication([]) engine = QQmlApplicationEngine() #load the qml engine.load("Main.qml") if not engine.rootObjects(): print("Failed to load main.qml:") exit(1) app.exec()
Main.qml
import QtQuick 2.15 import QtQuick.Controls 2.15 ApplicationWindow { id:appWindow visible: true width: 370 height: 370 maximumHeight: height maximumWidth: width minimumHeight: height minimumWidth: width title: "My App" }
nuitka-crash-report
<?xml version='1.0' encoding='utf8'?> <nuitka-compilation-report nuitka_version="2.4.8" nuitka_commercial_version="not installed" completion="error exit message (1)" exit_message="Failed unexpectedly in Scons C backend compilation."> <scons_error_reports> <scons_error_report> <command>clang -o "/home/simbad/qtProyects/testPyqt/deployment/main.dist/main.bin" -z noexecstack -Xlinker -export-dynamic -rdynamic -Wl,-R,'$ORIGIN' -Wl,--disable-new-dtags @"./@link_input.txt" -L/usr/lib -ldl -lm "/usr/lib/python3.10/config-3.10-x86_64-linux-gnu/libpython3.10-pic.a" -lz -lm -lutil -lpthread -lexpat</command> <stderr> /usr/bin/ld: ./__constants.o: in function `_createGlobalConstants':__constants.c:(.text+0x90): undefined reference to `__ubsan_handle_out_of_bounds'/usr/bin/ld: __constants.c:(.text+0xc2): undefined reference to `__ubsan_handle_out_of_bounds'/usr/bin/ld: __constants.c:(.text+0xfa): undefined reference to `__ubsan_handle_type_mismatch_v1'/usr/bin/ld: __constants.c:(.text+0x180): undefined reference to `__ubsan_handle_type_mismatch_v1'/usr/bin/ld: __constants.c:(.text+0x1b8): undefined reference to `__ubsan_handle_type_mismatch_v1'/usr/bin/ld: __constants.c:(.text+0x208): undefined reference to `__ubsan_handle_type_mismatch_v1'/usr/bin/ld: __constants.c:(.text+0x24a): undefined reference to `__ubsan_handle_type_mismatch_v1'/usr/bin/ld: ./__constants.o:__constants.c:(.text+0x2a6): more undefined references to `__ubsan_handle_type_mismatch_v1' follow/usr/bin/ld: ./__constants.o: in function `_createGlobalConstants':__constants.c:(.text+0xa43): undefined reference to `__ubsan_handle_out_of_bounds'/usr/bin/ld: ./__loader.o: in function `setupMetaPathBasedLoader':__loader.c:(.text+0x30): undefined reference to `__ubsan_handle_load_invalid_value'/usr/bin/ld: ./__loader.o: in function `_loadBytesCodesBlob':__loader.c:(.text+0xa0): undefined reference to `__ubsan_handle_load_invalid_value'/usr/bin/ld: ./__loader.o: in function `copyFrozenModulesTo':__loader.c:(.text+0x133): undefined reference to `__ubsan_handle_type_mismatch_v1'/usr/bin/ld: __loader.c:(.text+0x163): undefined reference to `__ubsan_handle_type_mismatch_v1'/usr/bin/ld: __loader.c:(.text+0x1a2): undefined reference to `__ubsan_handle_type_mismatch_v1'/usr/bin/ld: __loader.c:(.text+0x1d2): undefined reference to `__ubsan_handle_type_mismatch_v1'/usr/bin/ld: __loader.c:(.text+0x211): undefined reference to `__ubsan_handle_type_mismatch_v1'/usr/bin/ld: ./__loader.o:__loader.c:(.text+0x249): more undefined references to `__ubsan_handle_type_mismatch_v1' follow/usr/bin/ld: ./__loader.o: in function `copyFrozenModulesTo':__loader.c:(.text+0x273): undefined reference to `__ubsan_handle_out_of_bounds'/usr/bin/ld: __loader.c:(.text+0x2b6): undefined reference to `__ubsan_handle_type_mismatch_v1'/usr/bin/ld: __loader.c:(.text+0x2f5): undefined reference to `__ubsan_handle_type_mismatch_v1'/usr/bin/ld: __loader.c:(.text+0x32d): undefined reference to `__ubsan_handle_type_mismatch_v1'/usr/bin/ld: __loader.c:(.text+0x36c): undefined reference to `__ubsan_handle_type_mismatch_v1'/usr/bin/ld: __loader.c:(.text+0x3a4): undefined reference to `__ubsan_handle_type_mismatch_v1'/usr/bin/ld: ./__loader.o:__loader.c:(.text+0x3e1): more undefined references to `__ubsan_handle_type_mismatch_v1' follow/usr/bin/ld: ./module.PySide6-postLoad.o: in function `modulecode_PySide6$$45$postLoad':module.PySide6-postLoad.c:(.text+0x62): undefined reference to `__ubsan_handle_load_invalid_value'/usr/bin/ld: module.PySide6-postLoad.c:(.text+0xb4): undefined reference to `__ubsan_handle_out_of_bounds'/usr/bin/ld: module.PySide6-postLoad.c:(.text+0xe9): undefined reference to `__ubsan_handle_type_mismatch_v1'/usr/bin/ld: module.PySide6-postLoad.c:(.text+0x136): undefined reference to `__ubsan_handle_out_of_bounds'/usr/bin/ld: module.PySide6-postLoad.c:(.text+0x165): undefined reference to `__ubsan_handle_type_mismatch_v1'/usr/bin/ld: module.PySide6-postLoad.c:(.text+0x1a6): undefined
thanks a lot.
-
@JonB
I finally managed to generate an executable using cx_Freeze. Then by copying the directory that contains the .qml files in the same dir of the executable, I made the application run without problems.
Soon I will continue using pyside6-deploy in the way you suggest. Thank you so much