l a b e l i m g 打 包 e x e labelimg打包exe labelimgexe

一 安装

pip install labelimg -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com

二 检测是否安装成功

cmd窗口输入

labelimg打包exe_python

labelimg

labelimg打包exe_打包工具_02

三 在site-packages中找到labelimg

labelimg打包exe_可执行文件_03

四 打包成exe

4.1 安装打包工具pyinstaller

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyinstaller

labelimg打包exe_可执行文件_04

4.2 在当前文件夹下进入cmd,进行打包

pyinstaller -F -w labelImg.py  

labelimg打包exe_测试运行_05

labelimg打包exe_python_06

labelimg打包exe_测试运行_07
labelimg打包exe_python_08

查看打包后的exe,并双击测试运行

labelimg打包exe_可执行文件_09
labelimg打包exe_打包工具_10

成功

labelimg打包exe_打包工具_11

五 在python中实现调用可执行文件.exe

import os 
main = "project1.exe" # exe的路径
r_v = os.system(main) 
print (r_v )