I am trying to build QtWebEngine myself and use the build for a python script. I have been following along with this question's step by step answer: How to compile Qt webengine (5.11) on Windows with proprietary codecs and have managed to build the exe. Then when I first tried to run the exe (on it's own or within my own python script), it gave me an error: The application was unable to start correctly (0xc000007b)
. As well as this I realized the QtWebEngineProcess exe in the qtwebengine folder installed by pip is 578KB whereas the exe I build was only 16KB which seems very odd.
Then I saw in this question https://forum.qt.io/topic/65974/the-application-was-unable-to-start-correctly-0xc000007b/2 one person says to run the exe with windeployqt, I did this and it generated lots of files around the QtWebEngineProcess.exe file which allowed it to be run in that folder as in although of course nothing happens, it doesn't give an error.
However, the idea of this is to run the exe using my python script so I have tried somehow replacing it in my python directory but have had no luck. When just replacing the exe it gives me the same The application was unable to start correctly
error. When I replace the whole bin folder it gives me this error in python: ImportError: DLL load failed while importing QtWidgets: %1 is not a valid Win32 application.
Also, my PyQt5 and PyQtWebEngine versions in python are both 5.15.4
however the version I used when compliling is 5.9.9
. I realize this could be a very basic mistake however I couldn't find 5.15.4
in the Qt installer and so just went with that. Any ideas on why this behaviour is happening and how I can fix it so that I can use the build in my python script? Any help is appreciated.