Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

labelImg command error: AssertionError: Missing string id : useDefaultLabel #404

Closed
ShubhamAvasthi opened this issue Dec 4, 2018 · 21 comments

Comments

@ShubhamAvasthi
Copy link

  • OS: Ubuntu
  • PyQt version: PyQt5

labelImg command gives me the following error on my installation and I am unable to figure out a fix for the problem:

Traceback (most recent call last): File "/usr/local/bin/labelImg", line 11, in <module> sys.exit(main()) File "/home/shubham/.local/lib/python3.6/site-packages/labelImg/labelImg.py", line 1473, in main app, _win = get_main_app(sys.argv) File "/home/shubham/.local/lib/python3.6/site-packages/labelImg/labelImg.py", line 1466, in get_main_app argv[3] if len(argv) >= 4 else None) File "/home/shubham/.local/lib/python3.6/site-packages/labelImg/labelImg.py", line 130, in __init__ self.useDefaultLabelCheckbox = QCheckBox(getStr('useDefaultLabel')) File "/home/shubham/.local/lib/python3.6/site-packages/labelImg/labelImg.py", line 95, in <lambda> getStr = lambda strId: self.stringBundle.getString(strId) File "/home/shubham/.local/lib/python3.6/site-packages/libs/stringBundle.py", line 36, in getString assert(stringId in self.idToMessage), "Missing string id : " + stringId AssertionError: Missing string id : useDefaultLabel

@siahuat0727
Copy link

Did you forget to make ?
Try make qt5py3

@Partha2k
Copy link

Partha2k commented Dec 5, 2018

I am having the same issue.
Platform: Windows + Anaconda
PyQt Version: pyqt 5

@zh7117
Copy link

zh7117 commented Dec 5, 2018

I cant make.
but I tried :
pyrcc5 -o resources.py resources.qrc

and then it works.

@ShubhamAvasthi ShubhamAvasthi changed the title labelImg comaand error: AssertionError: Missing string id : useDefaultLabel labelImg command error: AssertionError: Missing string id : useDefaultLabel Dec 5, 2018
@williamoverthetop
Copy link

I am having the issue as well
Platform: MacOs Mojave10.14.1
PyQt Version: pyqt 5

@wuqingshan2010
Copy link

I am having the issue as well

@AdritaBarari
Copy link

I was having the same issue on WIndows 10 + Anaconda platform with python 3.6. but as @zh7117 suggested
pyrcc5 -o resources.py resources.qrc works

@wuqingshan2010
Copy link

i had tried it, we must cd into the LabelImg file and input the command "pyrcc5 -o resources.py resources.qrc"

@tzutalin
Copy link
Contributor

tzutalin commented Dec 7, 2018

There are new changes related to the resource. In general, it has to compile the resource again.
Go to the root, and run:
make qt5py3 or make qt4py2

@tzutalin tzutalin closed this as completed Dec 7, 2018
@williamoverthetop
Copy link

I am having the issue as well
Platform: MacOs Mojave10.14.1
PyQt Version: pyqt 5

as @wuqingshan2010 action, I fixed it, thanks!

@suntim
Copy link

suntim commented Jan 19, 2019

I am having the issue as well
Platform: MacOs Mojave10.14.1
PyQt Version: pyqt 5

how to solve

@ZidaneQi
Copy link

ZidaneQi commented Jun 6, 2020

After tried all methods above (didn't work), I found out the solution.
(both MacOS Mojave and Catakiina, Python3, PyQt5)

cd into the LabelImg file and input the command: make all

then: python labelimg.py

@yasersakkaf
Copy link

yasersakkaf commented Jul 5, 2020

In Windows + Anaconda installations, I am getting the same error.
Any solution found?

$>python labelImg.py

Traceback (most recent call last):
  File "labelImg.py", line 1475, in <module>
    sys.exit(main())
  File "labelImg.py", line 1471, in main
    app, _win = get_main_app(sys.argv)
  File "labelImg.py", line 1464, in get_main_app
    argv[3] if len(argv) >= 4 else None)
  File "labelImg.py", line 120, in __init__
    self.useDefaultLabelCheckbox = QCheckBox(getStr('useDefaultLabel'))
  File "labelImg.py", line 85, in <lambda>
    getStr = lambda strId: self.stringBundle.getString(strId)
  File "C:\Users\Yaser.Sakkaf\Downloads\labelImg-master\libs\stringBundle.py", line 43, in getString
    assert(stringId in self.idToMessage), "Missing string id : " + stringId
AssertionError: Missing string id : useDefaultLabel

@MahaQ3
Copy link

MahaQ3 commented Aug 13, 2020

I faced same issue and solving it like this:

1- typing in cmd:

cd path_to_lablelImg_folder
pyrcc5 -o resources.py resources.qrc

2- Change the location of resources.qrc and resource files to libs folder.

3- typing in cmd:

cd path_to_lablelImg_folder/libs
pyrcc5 -o resources.py resources.qrc
cd ..
python labelImg.py

I hope this help to all.
-notice: every line is separate command and my Platform is: Windows + Anaconda

@udayposia
Copy link

udayposia commented Feb 18, 2022

I am facing the same problem even after following the above solution!!!

  1. I Cloned the repository.
  2. Used these commands pyrcc5 -o libs/resources.py resources.qrc python labelImg.py
  3. Still error :
    labelImg\libs\stringBundle.py", line 47, in get_string assert(string_id in self.id_to_message), "Missing string id : " + string_id AssertionError: Missing string id : useDefaultLabel

@snigdhasaha7
Copy link

Same here - I have tried everything above and I'm still facing the error.

For reference, I'm running on the conda environment on Windows.

Here's my error to be specific:

Traceback (most recent call last):
File "labelImg.py", line 1649, in
sys.exit(main())
File "labelImg.py", line 1645, in main
app, _win = get_main_app(sys.argv)
File "labelImg.py", line 1638, in get_main_app
args.save_dir)
File "labelImg.py", line 124, in init
self.use_default_label_checkbox = QCheckBox(get_str('useDefaultLabel'))
File "labelImg.py", line 87, in
get_str = lambda str_id: self.string_bundle.get_string(str_id)
File "C:\Users\name\labelImg\libs\stringBundle.py", line 47, in get_string
assert(string_id in self.id_to_message), "Missing string id : " + string_id
AssertionError: Missing string id : useDefaultLabel

@peoplecure
Copy link

peoplecure commented Feb 20, 2022

Hello all,

If above solutions did not work, try installing this version instead :

cd [YOUR FOLDER]
git clone https://github.com/peoplecure/labellmg.git

cd [FOLDER CONTAINING labellmg]

brew install python3
pip3 install pipenv
pipenv run pip install pyqt5==5.15.2 lxml
pipenv run make qt5py3
pipenv run python3 labelImg.py
[Optional] rm -rf build dist; python setup.py py2app -A;mv "dist/labelImg.app" /Applications

Fyi, I'm using macOS

@Rurouni-z
Copy link

Rurouni-z commented Feb 20, 2022

conda create a virtual env, then pip install labelimg then labelimg finally it worked.
my python version=3.6 use Windows

@AhmadMuhamed
Copy link

conda create a virtual env, then pip install labelimg then labelimg finally it worked. my python version=3.6 use Windows

Thanks man after several ours it worked finally

@AhmadMuhamed
Copy link

Here is the solution worked for me :
conda create -env labelimg
conda activate labelimg
pip install labelimg
labelimg

@JulianToppo
Copy link

conda create a virtual env, then pip install labelimg then labelimg finally it worked. my python version=3.6 use Windows

Thanks a lot man! 💯 It worked but i still can't figure out why would it throw an error when the already existing virtual env i created had all the required files.

@Elegadro
Copy link

Hello all,

If above solutions did not work, try installing this version instead :

cd [YOUR FOLDER]
git clone https://github.com/peoplecure/labellmg.git

cd [FOLDER CONTAINING labellmg]

brew install python3
pip3 install pipenv
pipenv run pip install pyqt5==5.15.2 lxml
pipenv run make qt5py3
pipenv run python3 labelImg.py
[Optional] rm -rf build dist; python setup.py py2app -A;mv "dist/labelImg.app" /Applications

Fyi, I'm using macOS

Thank you. I'm using Windows but this solution works for me. I just changed

brew install python3
pip3 install pipenv
pipenv run pip install pyqt5==5.15.2 lxml
pipenv run make qt5py3
pipenv run python3 labelImg.py
[Optional] rm -rf build dist; python setup.py py2app -A;mv "dist/labelImg.app" /Applications

this part. Instead of,

pyrcc5 -o resources.py resources.qrc
python labelImg.py

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests