我的安裝方式的從源碼編譯,環境為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) [email protected]:~/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了