天天看点

运行labelImg时报错 ModuleNotFoundError: No module named ‘libs.resources‘

现象

在github(https://github.com/tzutalin/labelImg)下载labelImg后,运行labelImg.py文件后,提示没有PyQt5模块和Sip模块,通过pip安装了两个模块后,运行出现以下错误:

ModuleNotFoundError: No module named 'libs.resources'

解决

在官网(https://github.com/tzutalin/labelImg)看到以下方法

运行labelImg时报错 ModuleNotFoundError: No module named ‘libs.resources‘

运行了

pyrcc4 -o libs/resources.py resources.qrc

还不行

但运行了

pyrcc5 -o libs/resources.py resources.qrc

之后,就可以正常运行labelImg.py了

运行labelImg时报错 ModuleNotFoundError: No module named ‘libs.resources‘

另外(更简单的方法)

直接pip安装 labelImg 更方便

pip install labelImg

很快(5秒)左右就可以安装成功,之后在cmd运行

labelImg

就可以运行软件了。很方便吧!

运行labelImg时报错 ModuleNotFoundError: No module named ‘libs.resources‘

官网上,又有其他安装方法,有兴趣的自己去看看吧!

继续阅读