打包编译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脚本的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-05-08有遇到过吗?同样的规则 Excel 中 比Python 结果大
- 2024-03-30开始python成长之路
- 2024-03-29python optparse
- 2024-03-29python map 函数
- 2024-03-20invalid format specifier python
- 2024-03-18pool.map python
- 2024-03-18threads in python
- 2024-03-14python Ai 应用开发基础训练,字符串,字典,文件
- 2024-03-13id3 algorithm python
- 2024-03-13sum array elements python