I homed in on it because any piece of code that uses a relative path to 
locate an application resource is broken (it’s relative to your current 
working directory which could be anywhere, not the application root, but 
IDEs hide this bug by setting your current working directory to the 
location of your code) and that false assumption gets flushed out pretty 
quickly when you run PyInstaller on it. If you’re not convinced, try 
opening or cd-ing a terminal somewhere far away from your original python 
code and running python /full/path/to/your/code.py. I expect that you’ll 
get the same error.

To be clear, what I think is happening is that Qt can’t find that QML file, 
whether you correctly packaged it or not, for the reasons described above. 
Qt doesn’t raise an error (although it does print a warning) so the code 
continues on but it never managed to load any UI objects from the QML file 
so engine.rootObjects() is an empty list and that’s why you’re getting an 
IndexError on that line.
​

-- 
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/5db0cd9b-8abd-4fba-b99e-57aba79ba336n%40googlegroups.com.

Reply via email to