Did a quick test and PyInstaller definitely creates a slightly different env when compiled than it does when running as a script. It prepends an extra item to the PATH variable, and also sets the QT_PLUGIN_PATH to its own PyQt6 plugins folder. THAT will definitely affect Sigil adversely when launching via a subprocess. You'd need to scrub that (and the QML2_IMPORT_PATH for good measure) variable from a copy of the system environment and pass that via the env parameter to subprocess.Popen().
Hope something there helps.
|