python使用Pyinstaller打包
一、前言
python文件打包,将.py文件转化成.exe文件(windows平台),可以使用Pyinstaller来打包
Pyinstaller可以在全平台下使用,但是请注意打包生成的文件不能在全平台使用,需要在不同平台下打对应的包
二、Pyinstaller安装
使用pip可以很方便的安装Pyinstaller
pip installer Pyinstaller
如果没有安装pip,可以先安装pip,pip安装参考https://blog.csdn.net/liuchunming033/article/details/39578019
三、Pyinstaller使用
Pyinstaller将.py文件打包很便捷,只需要一条指令即可;这里的测试文件为test.py
Pyinstaller test.py
这种方式打包会生成一个文件夹,运行的时候会有一个console窗口
打包生成单文件可以在指令中加上-F 或者 --onefile
打包生成单文件程序的启动速度会很慢,尤其是调用了GUI界面的时候;
程序会在所有模块都加载完成后再显示GUI界面,可以使用--onedir打包生成一个文件夹,但是启动速度有明显改善。
Pyinstaller -F test.py
//或者
Pyinstaller test.py --onefile
打包生成的exe文件运行的时候不带console窗口
Pyinstaller -W test.py
//或者
pyinstaller test.py --noconsole
打包生成的图标默认使用的是python的图标,使用自己的图标可以用 -I来设置自己想要的图标
Pyinstaller test.py -i ico.ico
我的参考:https://iassas.com/archives/2329ebda.html
python使用Pyinstaller打包的更多相关文章
- python用pyinstaller打包成exe文件
版本为Python2.7 一.安装Pyinstaller 1.安装pywin32 下载安装文件:查找到跟自己适用的python版本及window系统版本匹配的pywin32,下载后安装 使用pip命 ...
- 【Python】pyinstaller打包运行报错failed to execute script main
前言 最近用pyinstaller打包的时候一直报"failed to execute script main". 最终使用"pyinstaller --hidden-i ...
- python 使用pyinstaller打包程序
使用pyinstaller 打包.py脚本,在其他计算机可以直接运行,不需要python环境 安装pyinstaller库 pip install pystaller 打包程序 pyinstaller ...
- Python | 用Pyinstaller打包发布exe应用
参考:https://jingyan.baidu.com/article/a378c960b47034b3282830bb.html https://ask.csdn.net/questions/72 ...
- python pyinstaller 打包exe报错
今天用python 使用pyinstaller打包exe出现错误 环境pyqt5 + python3.6 在导入pyqt5包之前加上如下代码 import sysimport osif hasattr ...
- 利用PyInstaller打包exe文件
前言 平常我们通过Python写完一些小脚本之后,如果使用不频繁的话,一般会选择在DOS界面直接跑脚本,或者在IDE中运行.但当我们需要频繁使用某些脚本,或者在没有Python环境的机器上也能顺利运行 ...
- [python学习笔记] pyinstaller打包pyqt5程序无法运行
问题 pyinstaller打包的pyqt5程序在部分电脑上会失败.用户截图提示下边错误日志 无法定位程序输入点 ucrtbase.terminate 于动态链接库 api-ms-win-crt-ru ...
- win10环境下利用pyinstaller把python代码(.py)打包成可执行文件(.exe)
前言 最近写了一个小小的检测程序,python写起来只需要短短一百行,可是打包起来就没有C那么容易了.下面记录一下我艰难的"打包"过程. 方法一:py2exe py2exe是一种经 ...
- PyInstaller 打包 python程序成exe
pychaim下PyInstaller 打包 python程序 主题是使用PyInstaller 打包python时遇到一些问题以及解决方案,其中将要打包的程序是用tensorflow做的LSTM算法 ...
随机推荐
- osg Error osgearth_viewerd fails with "Loaded scene graph does not contain a MapNode
void StateSet::setGlobalDefaults() ShaderPipeline disabled.void StateSet::setGlobalDefaults() Shader ...
- Day1作业1:登陆接口(加入日志、注册功能)
流程图如下: 最先考虑使用python中的list,以能取到user_list中的用户信息,但中途发现没有比较好的方法截取取密码,还是新手的缘故,最终选择了使用dict,以方便截取用户名以及相应的密码 ...
- 增强篇6 CMOD增强删除
CMOD实施了一个增强,但是不需要了,怎么删除呢? 要删除PPCO0005 这个增强,进入编辑状态,发现没有删除按钮, 把PPCO0005 这项删除掉 敲回车,厉害了,他又回来了,所以在这里是没法删 ...
- 基于Broadcast 状态的Flink Etl Demo
接上文: [翻译]The Broadcast State Pattern(广播状态) 最近尝试了一下Flink 的 Broadcase 功能,在Etl,流表关联场景非常适用:一个流数据量大,一个流数据 ...
- LeetCode_278. First Bad Version
278. First Bad Version Easy You are a product manager and currently leading a team to develop a new ...
- JS中的match和test正则表达式验证密码或用户名的一种规则
match语法:字符串.match(正则表达式)有符合的:返回符合的数组无符合的:返回null test语法:正则表达式.test(字符串)有符合的:返回true无符合的 :返回false 该文的密码 ...
- 汉字转拼音插件:LM-PinYin.js
CDN:http://dtdxrk.github.io/jsPlug/pinyin/LM-PinYin.js demo演示地址:http://dtdxrk.github.io/jsPlug/pinyi ...
- 15点睛Spring4.1-TaskExecutor
转发:https://www.iteye.com/blog/wiselyman-2212679 15.1 TaskExecutor spring的TaskExecutor为在spring环境下进行并发 ...
- 07点睛Spring4.1-BeanPostProcessor
7.1 BeanPostProcessor spring通过BeanPostProcessor接口可以对所有bean或者指定的某些bean的初始化前后对bean的检查或者修改提供支持; 使用postP ...
- springboot的propteis的基本配置参考
其中mybatis.cfg.xml文件可以不加,这个文件最主要是开启mybatis的二级缓存: