为了防止出现> This application failed to start because it could not find or load the Qt platform plugin “windows” 错误,如Cx_Freeze Pyqt5 - pythonexample.com这里简述的,我们需要PyQt5的库位置
import sys from cx_Freeze import setup, Executable
path_platforms = ( "C:\\Users\\zhaon\\Anaconda3\\pkgs\\qt-5.9.5-vc14he4a7d60_0\\Library\\plugins\\platforms\\qwindows.dll", "platforms\qwindows.dll" ) includefiles = [path_platforms] # Dependencies are automatically detected, but it might need fine tuning. build_exe_options = {"packages": ["os"], "excludes": ["tkinter"], "include_files": includefiles,}
# GUI applications require a different base on Windows (the default is for a # console application). base = None if sys.platform == "win64": base = "Win64GUI"