1.安装pyinstaller.exe
使用pip install命令(直接用命令,会存在镜像找不到的问题,可以使用国内镜像)
pip3 install pyinstaller -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
2.pyinstaller.exe -F E:\ningwy\smscode.py
备注:打包命令-pyinstaller.exe
参数:
-F, –onefile 打包成一个exe文件。
-D, –onedir 创建一个目录,包含exe文件,但会依赖很多文件(默认选项)。
-c, –console, –nowindowed 使用控制台,无界面(默认)
-w, –windowed, –noconsole 使用窗口,无控制台
一般成功了,会在打包的目录下生成build和dist文件夹及.spec文件
编译python文件成.exe文件
最新推荐文章于 2024-05-07 04:43:13 发布