[PyQt] Pyqtdeploy - build pyqt app on Windows

Phil Thompson phil at riverbankcomputing.com
Thu Aug 22 10:28:36 BST 2019


On 22/08/2019 10:04, Mạnh Tú Vũ wrote:
> Hello,
> 
> I'm trying to build my PyQt application on Windows and I'm not sure 
> that I
> understand the way it works. I have built my application into a .exe 
> binary
> file but when I was trying to run, it threw an exception of:
> 
> C:\boatswain\boatswain\build-win-32>release\Boatswain.exe
>> 
>> Log file:
>>> C:\Users\manhtu\AppData\Local\theboatswain\boatswain\Logs\boatswain.log
>> 
>> Traceback (most recent call last):
>> 
>> File "bootstrap.py", line 983, in _find_and_load
>> 
>> File "bootstrap.py", line 967, in _find_and_load_unlocked
>> 
>> File "bootstrap.py", line 668, in _load_unlocked
>> 
>> File "bootstrap.py", line 638, in _load_backward_compatible
>> 
>> File ":/boatswain/__init__.py", line 1, in <module>
>> 
>> File "bootstrap.py", line 983, in _find_and_load
>> 
>> File "bootstrap.py", line 967, in _find_and_load_unlocked
>> 
>> File "bootstrap.py", line 668, in _load_unlocked
>> 
>> File "bootstrap.py", line 638, in _load_backward_compatible
>> 
>> File ":/boatswain/main.py", line 22, in <module>
>> 
>> File "bootstrap.py", line 983, in _find_and_load
>> 
>> File "bootstrap.py", line 953, in _find_and_load_unlocked
>> 
>> File "bootstrap.py", line 219, in _call_with_frames_removed
>> 
>> File "bootstrap.py", line 983, in _find_and_load
>> 
>> File "bootstrap.py", line 967, in _find_and_load_unlocked
>> 
>> File "bootstrap.py", line 668, in _load_unlocked
>> 
>> File "bootstrap.py", line 638, in _load_backward_compatible
>> 
>> File ":/PyQt5/__init__.py", line 41, in <module>
>> 
>> File ":/PyQt5/__init__.py", line 33, in find_qt
>> 
>> ImportError:
>> 
>> unable to find Qt5Core.dll on PATH
>> 
>> 
> I suspect, the Qt application was trying to find Qt5Core.dll library,
> however, I see in the Makefile.Release, we had already
> included  sysroot-win-32\qt\lib\Qt5Core.lib into the application. So, 
> why
> do we need the .dll library again?
> 
>> LIBS          = /LIBPATH:C:\boatswain\boatswain\sysroot-win-32\lib
>> /LIBPATH:C:\boatswain\boatswain\sysroot-win-32\l... 
>> C:\boatswain\boatswain\sysroot-win-32\qt\lib\Qt5Core.lib
>> ...
>> 
> 
> I have tried to run the app using Qt command line and see it worked.
> Because the required libraries are already included in the PATH env. 
> So,
> does it mean that I have to distribute the .dll libraries with my
> application as well?

If you haven't built a static version of the Qt libraries then yes.

Phil


More information about the PyQt mailing list