Qt issue after compiling Windows build
SleepyPrince opened this issue · 4 comments
I have followed the Build from Source instructions and was able to compile funscript-editor and the associated files. However when I try to start it, it always give me the 'This application failed to start because it could not find or load the Qt platform plugin "windows" in "".' error.
I tried comparing my build with the release build only to find minimal difference in some library file size.
Even after adding the QT_PLUGIN_PATH variable manually does not fix the issue.
I have attached a build log below.
build_log.txt
It seems that the dll files in the QT\plugins\platforms folder (especially qwindows.dll) has quite a different in size compared with the released version. I copied the dll files over and it is now working. Still don't know what caused the issue.
I compared your build log with mine but i found no relevant differences:
diff --git a/build.log b/build.log
index cfa1530..0ed63d6 100644
--- a/build.log
+++ b/build.log
@@ -1,8 +1,8 @@
INFO: PyInstaller: 4.3
INFO: Python: 3.9.5 (conda)
-INFO: Platform: Windows-10-10.0.14393-SP0
+INFO: Platform: Windows-10-10.0.19042-SP0
INFO: wrote C:\Users\win10\Downloads\Python-Funscript-Editor\funscript-editor.spec
-INFO: UPX is not available.
+INFO: UPX is available.
INFO: Extending PYTHONPATH with paths
['C:\\Users\\win10\\Downloads\\Python-Funscript-Editor',
'C:\\Users\\win10\\Downloads\\Python-Funscript-Editor']
@@ -54,19 +54,7 @@ INFO: Matplotlib backend "Qt5Cairo": ignored
INFO: Matplotlib backend "TkAgg": added
INFO: Matplotlib backend "TkCairo": ignored
cairo backend requires that pycairo>=1.11.0 or cairocffi is installed
-INFO: Matplotlib backend "WebAgg": ignored
- Traceback (most recent call last):
- File "c:\users\win10\miniconda3\envs\build\lib\site-packages\matplotlib\backends\backend_webagg.py", line 27, in <module>
- import tornado
-ModuleNotFoundError: No module named 'tornado'
-
-The above exception was the direct cause of the following exception:
-
-Traceback (most recent call last):
- File "<string>", line 12, in <module>
- File "c:\users\win10\miniconda3\envs\build\lib\site-packages\matplotlib\backends\backend_webagg.py", line 29, in <module>
- raise RuntimeError("The WebAgg backend requires Tornado.") from err
-RuntimeError: The WebAgg backend requires Tornado.
+INFO: Matplotlib backend "WebAgg": added
INFO: Matplotlib backend "WX": ignored
No module named 'wx'
INFO: Matplotlib backend "WXAgg": ignored
@@ -170,4 +158,6 @@ INFO: Building EXE from EXE-00.toc completed successfully.
INFO: checking COLLECT
INFO: Building COLLECT because COLLECT-00.toc is non existent
INFO: Building COLLECT COLLECT-00.toc
+INFO: Executing - upx --lzma -q C:\Users\win10\AppData\Local\pyinstaller\bincache01_py39_64bit\tornado\speedups.cp39-win_amd64.pyd
+upx: C:\Users\win10\AppData\Local\pyinstaller\bincache01_py39_64bit\tornado\speedups.cp39-win_amd64.pyd: NotCompressibleException
INFO: Building COLLECT COLLECT-00.toc completed successfully.
It looks like you have installed the additional package tornado
which should not make any difference.
Could you also provide the output of conda env export
of the activated build environment (after the command conda activate build
). Use conda env export > myenv.yaml
to put the output into a file. I suspect that a dependency installed on the system is used for the build. Maybe you have qt installed as a pip package?
Additional Notes:
For the older releases I use a clean Windows VM to build the application, the new releases are built with this github action - identical to the build script)
Found the culprit from the build diff, it was upx. I had upx in my PATH and pyinstaller used it to compress dlls which corrupts qwindows.dll. After using --noupx or --upx-exclude qwindows.dll to build, the editor can now start normally. Probably safer to use --noupx since we don't know which dll upx does not play well with.
Glad to hear it worked and thanks for the note with the --noupx
flag. I added it to the build script.