ubuntu的labelimg安裝筆記(python2和python3記錄)
阿新 • • 發佈:2019-01-25
這裡僅記載下labelImg的安裝過程,因為有坑。
我的安裝方式是從原始碼編譯,環境ubuntu16.04,一開始是使用python2安裝,從github上下載好原始碼,然後執行安裝命令
sudo apt-get install pyqt4-dev-tools sudo pip install lxml make qt4py2 python labelImg.py
make qt4py2的時候,會顯示如下
pyrcc4 -py2 -o resources.py resources.qrc Couldn't open /home/wzy/labelImg-master/icons/next.png Couldn't open /home/wzy/labelImg-master/icons/zoom-out.png Couldn't open /home/wzy/labelImg-master/icons/format_voc.png Couldn't open /home/wzy/labelImg-master/icons/expert2.png Couldn't open /home/wzy/labelImg-master/icons/copy.png Couldn't open /home/wzy/labelImg-master/icons/format_yolo.png Couldn't open /home/wzy/labelImg-master/icons/color_line.png Couldn't open /home/wzy/labelImg-master/icons/prev.png Couldn't open /home/wzy/labelImg-master/icons/cancel.png Couldn't open /home/wzy/labelImg-master/icons/edit.png Couldn't open /home/wzy/labelImg-master/icons/labels.png Couldn't open /home/wzy/labelImg-master/icons/color.png Couldn't open /home/wzy/labelImg-master/icons/close.png Couldn't open /home/wzy/labelImg-master/icons/quit.png Couldn't open /home/wzy/labelImg-master/icons/fit-window.png Couldn't open /home/wzy/labelImg-master/icons/fit-width.png Couldn't open /home/wzy/labelImg-master/icons/resetall.png Couldn't open /home/wzy/labelImg-master/icons/eye.png Couldn't open /home/wzy/labelImg-master/icons/undo.png Couldn't open /home/wzy/labelImg-master/icons/save-as.png Couldn't open /home/wzy/labelImg-master/icons/done.png Couldn't open /home/wzy/labelImg-master/icons/open.png Couldn't open /home/wzy/labelImg-master/icons/app.png Couldn't open /home/wzy/labelImg-master/icons/file.png Couldn't open /home/wzy/labelImg-master/icons/help.png Couldn't open /home/wzy/labelImg-master/icons/zoom.png Couldn't open /home/wzy/labelImg-master/icons/save.png Couldn't open /home/wzy/labelImg-master/icons/zoom-in.png Couldn't open /home/wzy/labelImg-master/icons/verify.png Couldn't open /home/wzy/labelImg-master/icons/objects.png
再然後執行labelImg.py會報錯
Traceback (most recent call last): File "labelImg.py", line 29, in <module> import resources File "/home/wzy/文件/labelImg-master/resources.py", line 9, in <module> from PyQt4 import QtCore ImportError: No module named PyQt4
找不到pyqt4,然額明明安裝過。
於是改用python3,OK了,命令如下,與Python2很像。
sudo apt-get install pyqt5-dev-tools sudo pip3 install lxml make qt5py3 python3 labelImg.py
軟體截圖如下