简述下如何在Windows上用Cx_Freeze正确打包GUI程序
为了防止出现> This application failed to start because it could not find or load the Qt platform plugin “windows” 错误,如Cx_Freeze Pyqt5 - pythonexample.com 这里简述的,我们需要PyQt5的库位置
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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" , "platformsqwindows.dll" )
includefiles = [path_platforms]
build_exe_options = {"packages" : ["os" ],
"excludes" : ["tkinter" ],
"include_files" : includefiles,}
base = None
if sys.platform == "win64" :
base = "Win64GUI"
setup(name="QuickJump" ,
version="0.9" ,
description="application!" ,
options={"build_exe" : build_exe_options},
executables=[Executable("app.py" , base=base)])
再python setup.py bdist_msi
即可打包msi安装包。
近期评论