打包编译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

原文地址:https://www.cnblogs.com/xwupiaomiao/p/14788604.html