labelImg无法正常使用的有效解决办法

使用的是labelImg-1.8.0,个人经验,使用python2可以方便正常使用。

下载地址:https://github.com/ArmendLee/labelImg-1.8.0

0.下载后运行:

python2 labelImg.py

如果报错:
Traceback (most recent call last):
 File "labelImg.py", line 29, in 
   import resources
ImportError: No module named resources

解决方法:
屏蔽labelImg.py中29行的resources:
#import resources

再运行python2 labelImg.py, 还报错的话,按下面方法处理:

1.终端输入python,如果是 Anaconda的python,打开sudo gedit ~/.bashrc,屏蔽,source ~/.bashrc。

2.切换python:

(1) sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 100
(2) sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 150
(3) 通过sudo update-alternatives --config python选择相应的序号选择Python版本.

切换为Python2

3. sudo apt-get install python-qt4

4. 运行python labelImg.py

如果报错:
ImportError: No module named lxml

解决:
sudo apt-get install python-pip
pip install lxml -i https://pypi.tuna.tsinghua.edu.cn/simple

你可能感兴趣的:(bug修复)