python 项目打包 (pyinstaller)

 

步骤:1 安装pyinstaller -> 2 把第三方库的包复制到xxx.py同目录下 -> 3 pyinstaller -F 待打包文件名 (打包单个py文件) -> 4 check dist目录下生成的xxx.exe

1 install pyinstaller

pip install pyinstaller

2 第三方库

 3 pyinstaller -F 待打包文件名 (打包单个py文件)

 4 生成的.exe可执行文件

 

 

 

PS: 如果打包没问题,这个.exe是可以独立拿出去用的

issue 1: 打包过程没错误,执行.exe时遇到问题: no module named 'pkg_resources.py2_warn'

解决方法: ref: https://blog.csdn.net/slc1112/article/details/104234076

 

ref: https://blog.csdn.net/chenzhanhai/article/details/85334919

ref: https://www.cnblogs.com/it-tsz/p/10534654.html

 

posted @ 2020-05-06 16:07  Caesar_the_great  阅读(278)  评论(0编辑  收藏  举报