python3打包程序为exe

说在前头,能用pyinstaller不用cxfreeeze,cxfreeeze打包出来的东西太大

pyinstaller

下载

 pip install pyinstaller
 pip install pywin32    依赖

打包方法

pyinstaller a.py
坐等。。。
如果发生****deepth的错误
删除dist 和 build 文件
保留***。spec的文件
然后打开他,在上面写
	import sys
	sys.setrecursionlimit(5000)
然后pyinstaller ***.spec
坐等

cxfreeze

安装

pip install cx-freeze
然后在你安装的python的目录下有个
Scripts目录,进入它。
然后执行
python cxfreeze-postinstall
然后
在cmd中输入
cxfreeze -h验证

打包方法

cxfreeze a.py --target-dir E:/123
a.py是你的程序,-f 后头是保存的地方
发布了23 篇原创文章 · 获赞 22 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/qq_36389249/article/details/103427092
今日推荐