Hello,
Why do you think the bug is in the line: "engine.load('./UI/main.qml')" ?
I tried what you said, and read the pyinstaller docs you linked, but this
code is part of objects from PyQt6 not pyinstaller. So, I don't see what
you're getting at. After I made the changes you mentioned, the error
message is the same. "list index out of range" for the line
"engine.rootObjects()[0].setProperty('backend', backend)".
I'm not sure why this part of the code caught your eye, but perhaps it's
noteworthy to mention that I manually include the full path for the qml
file in the spec file each time I build the exe with Pyinstaller. I build
the spec file manually, manually enter the qml file path inside the spec
file, and then build the exe with pyinstaller from the spec file.
On Saturday, August 10, 2024 at 3:02:44 AM UTC-5 bwoodsend wrote:
> Your bug is the line engine.load('./UI/main.qml') (although the issue is
> masked by the fact that Qt doesn’t raise an error if it can’t load a file).
> Relative paths to locate application resources are not portable. I suggest
> you change that line to:
> qml_path = './UI/main.qml' if not os.path.exists(qml_path): raise
> FileNotFoundError(qml_path) engine.load(qml_path)
>
> which will not fix your issue but it will give you a proper error message.
> Then read the docs
> <https://pyinstaller.org/en/v6.9.0/runtime-information.html#using-file>
> for what qml_path should really be set to.
>
>
--
You received this message because you are subscribed to the Google Groups
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/pyinstaller/04228917-0692-42f2-ad3f-39b54474826fn%40googlegroups.com.