打包编译python脚本

2021/5/20 12:29:24

本文主要是介绍打包编译python脚本,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

生成requirements.txt依赖包文件
pip freeze > requirements.txt
安装requirements.txt依赖
pip install -r requirements.txt

安装
pip install pyinstaller
打包编译(打包之前请安装requirements.txt文件里的所有依赖包)
pyinstaller -F deploy.py --add-data 'config.yaml:.'
打包添加配置文件时,在windows上使用--add-data 'config.yaml;.',在Linux上使用--add-data 'config.yaml:.'

参考链接
       https://www.cnblogs.com/mywolrd/p/4756005.html
       https://www.cnblogs.com/caijunchao/p/12845620.html
       https://www.cnblogs.com/gopythoner/p/6337543.html



这篇关于打包编译python脚本的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程