labelImg installation error TypeError: qRegisterResourceData(int, str, str, str): argument 2 has unexpected type 's

labelImg installation error pyrcc4 or pyrcc5

Install from the labelImg written by the author of github, the address https://github.com/tzutalin/labelImg
is written by the author, the installation steps:

  1. pyrcc4 -o libs/resources.py resources.qrc
  2. python labelImg.py

pyrcc4 error

But running python labelImg.py will report the following error:

TypeError: qRegisterResourceData(int, str, str, str): argument 2 has unexpected type ‘str’

Insert image description here

Solution:

Add -py3 to the first sentence

1. pyrcc4 -py3 -o libs/resources.py resources.qrc
2. python labelImg.py

pyrcc5 error

Error: "XX" is not an internal or external command, as follows

Insert image description here
It should be an environment configuration problem. First check whether pyrcc5.exe is successfully installed in Scripts in the python installation directory.
Insert image description here
After successful installation, enter the LabelImg directory and add pyrcc.exe after it:

pyrcc5.exe -o libs/resources.py resources.qrc

If you do not find pyrcc5.exe, you need to install pyqt5-tools and PyQt5, the installation command:

pip install XXX -i https://pypi.mirrors.ustc.edu.cn/simple`

I have configured spyder and pyqt5 for a long time but the versions are always incompatible, but the incompatibility does not seem to affect the use of labelimg. You can use python to check
whether the import PyQt5 was successfully imported.
Finally, the installation was successful!
Insert image description here

Guess you like

Origin blog.csdn.net/qq_42740834/article/details/124376234