ubuntu下安装labelImg,亲测可行

我的安装方式的从源码编译,环境为ubuntu16.04

安装步骤:

1  从github上下载源码

https://github.com/tzutalin/labelImg

2 依次执行下面的命令

sudo apt-get install pyqt5-dev-tools
sudo pip3 install -r requirements/requirements-linux-python3.txt
make qt5py3
python3 labelImg.py

不出意外的话,敲入最后一行命令就会弹出labelImg的界面,表示安装成功。

但是!!!! 我在安装的时候当输入下面这行命令时出了问题:

make qt5py3

从网上搜到的结果是安装的pyqt5与sip的版本不匹配

(ssd) wx@wx-desktop:~/labelImg$ python3 labelImg.py
Traceback (most recent call last):
  File "labelImg.py", line 15, in <module>
    from PyQt5.QtGui import *
ModuleNotFoundError: No module named 'PyQt5'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "labelImg.py", line 24, in <module>
    import sip
ModuleNotFoundError: No module named 'sip'


解决办法:

卸载已经安装好的PyQt5,卸载的时候发现自己安装的版本是PyQt5-5.13.2

sudo pip3 uninstall PyQt5

只需要降低PyQt5的版本就好了,如何查看版本号呢?

在安装的时候随便写一个肯定不会存在的版本号,比如

PyQt5==5.12.20

敲入命令之后会提示错误信息如下:

ERROR: Could not find a version that satisfies the requirement PyQt5==5.12.14 (from versions: 5.7.1, 5.8, 5.8.1.1, 5.8.2, 5.9, 5.9.1, 5.9.2, 5.10, 5.10.1, 5.11.2, 5.11.3, 5.12, 5.12.1, 5.12.2, 5.12.3, 5.13.0, 5.13.1, 5.13.2)
ERROR: No matching distribution found for PyQt5==5.12.20

找一个低版本的就OK了

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值