PyQt5 编写并在Windows上用Cx_Freeze打包GUI程序

栏目: C++ · 发布时间: 6年前

内容简介:简述下如何在Windows上用Cx_Freeze正确打包GUI程序为了防止出现> This application failed to start because it could not find or load the Qt platform plugin “windows” 错误,如再

简述下如何在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的库位置

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"

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安装包。


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

跨境电商——阿里巴巴速卖通宝典

跨境电商——阿里巴巴速卖通宝典

速卖通大学 编著 / 电子工业出版社 / 2015-1 / 69.00元

跨境电商作为中国电子商务发展的最新趋势,受到了全社会越来越多的重视,大量中国卖家借助阿里巴巴速卖通平台,将产品直接售卖到全球的消费者手中,通过这条短得不能再短的交易链,获得了丰厚的回报。 但同时,跨境电商这一贸易形式,对卖家的综合素质要求比较高:卖家要对海外市场比较熟悉,对跨境物流有所把握,能够用外语进行产品介绍和客户交流,通过跨境结算拿到货款……诸如此类的门槛,让不少新卖家心生畏难,而所有......一起来看看 《跨境电商——阿里巴巴速卖通宝典》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具