labelimg的版本各不相同,安装大致流程基本一致。
一、Python安装
1.Python安装
Download Python | Python.org下载安装,建议3.9以上。
2.Python版本查看
python -V
二、使用下载源
2.1使用全局配置,建议使用豆瓣
配置好后您的pip安装第三方库将会选择您所设置的下载源:
如下配置一个阿里下载源
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple
pip config set install.trusted-host mirrors.aliyun.com
如下配置一个豆瓣下载源
pip config set global.index-url http://pypi.douban.com/simple
pip config set install.trusted-host pypi.douban.com
如下配置一个清华下载源
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
pip config set install.trusted-host pypi.tuna.tsinghua.edu.cn
如下配置一个中科大下载源
pip config set global.index-url https://pypi.mirrors.ustc.edu.cn/simple/
pip config set install.trusted-host pypi.mirrors.ustc.edu.cn
2.2使用单独下载源
如不想设置全局模式,则可以单独下载某个库下,选择你喜欢的下载源
清华源 https://pypi.tuna.tsinghua.edu.cn/simple/
pip install xxx -i https://pypi.tuna.tsinghua.edu.cn/simple/
阿里源 https://mirrors.aliyun.com/pypi/simple
pip install xxx -i https://mirrors.aliyun.com/pypi/simple
中科大源 https://pypi.mirrors.ustc.edu.cn/simple/
pip install xxx -i https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣源 http://pypi.douban.com/simple/
pip install xxx -i http://pypi.douban.com/simple/
三、安装pyQt5、sip
运行时提示缺少pyQt5和sip,安装解决:
pip install pyqt5
pip install sip
验证安装结果:
python -m pip show pyqt5
python -m pip show sip
四、缺少 lxml
模块
pip install lxml
验证安装结果:
python -m pip show lxml
五、缺少 libs.resources
原目录中有resources.qrc文件,转换成resources.py文件
Pyrcc5 -o resources.py resources.qrc
先得到①,再将①拷入②的路径中。
将生成的resources.py拷贝到libs文件中即可。
六、运行
路径根据实际路径修改
cd /d D:\labelImg-master
切换到labelimg-master路径后:
Python labelimg.py