0
点赞
收藏
分享

微信扫一扫

Python笔记-Linux平台中Flask打包成执行程序

郝春妮 2022-03-14 阅读 91

这里使用的是pyinstaller。这里要先安装python3。安装的使用如果没有带上

–enable-shared

要重新按下

./configure --prefix=/usr/local/python3 --enable-shared
echo "/usr/local/python3/lib/" >> /etc/ld.so.conf
ldconfig

安装pyinstaller

pip3 install pyinstaller 

然后就可以直接进行打包:

pyinstaller xxx.py

如果要打包成单独一个文件:

pyinstaller -F xxx.py

如果代码里面使用了importlib.import_module这类动态加载包的语法

pyinstaller --hidden-import 包名 xxx.py
举报

相关推荐

0 条评论