Pyinstaller Packaging Issues
Documenting some cross-platform issues I encountered when using pyinstall to package client applications.
1 Windows 7 Adaptation Issue
|
|
Python 3.9 and above no longer support Windows 7. If the software needs to run on Windows 7, the Python environment should be limited to version 3.8.
2 Missing Dynamic Runtime Libraries on Windows 7
|
|
Replace what’s missing by placing the DLL file into the program’s root directory or into C:/windows/System32
. However, this issue usually does not occur alone, as some dynamically loaded libraries were not included during PyInstaller packaging.
3 Partial Missing Qt Dynamic Loading
|
|
Solution 1: Place Sitepackages/QtGui
from the environment into the program’s root directory.
Solution 2: Use the packaging command pyinstaller main.py --noconsole --hidden-import PySide6.QtXml -F -p C:\Windows\System32\downlevel -p C:\Windows\System32
to manually load the missing modules by specifying hidden-import
.
4 pyinstaller could not get source code
Look backwards in the error log, manually copy the missing environment packages to the program’s root directory, or use hidden-import
to specify the import of these missing packages during packaging.