HumanSignal / labelImg

LabelImg is now part of the Label Studio community. The popular image annotation tool created by Tzutalin is no longer actively being developed, but you can check out Label Studio, the open source data labeling tool for images, text, hypertext, audio, video and time-series data.
https://youtu.be/p0nR2YsCY_U
MIT License
22.51k stars 6.27k forks source link

Bug executing `labelImg` with different python versions #343

Open juliusHuelsmann opened 6 years ago

juliusHuelsmann commented 6 years ago

By using the labelImg tool both with python2 and python3, I spotted the following bug ...

Traceback (most recent call last):
  File "labelImg.py", line 1459, in <module>
    sys.exit(main())
  File "labelImg.py", line 1455, in main
    app, _win = get_main_app(sys.argv)
  File "labelImg.py", line 1448, in get_main_app
    argv[3] if len(argv) >= 4 else None)
  File "labelImg.py", line 101, in __init__
    self.settings.load()
  File "/mnt/data/online/repos/dataspree/labelImage/labelImg/libs/settings.py", line 33, in load
    self.data = pickle.load(f)
ModuleNotFoundError: No module named 'PyQt4'

... that is caused by the Config file (at ~/.labelImgSettings.pkl) storing the dependencies used during the first execution. When using a different python version now (that has not qt4 installed), loading throws the aforementioned module not found error.

As this is only a tiny bug that is unlikely to affect anyone who really uses the tool in production, maybe it is sufficient to notify the user to remove the respective file herself.

zhaoxuyan commented 4 years ago

For Windows

Go to Users\xxx\ delete .labelImgSettings.pkl,then pyrcc5 -o libs/resources.py resources.qrc, python labelImg.py

For Mac or Linux

Go to home(~) folder, rm .labelImgSettings.pkl, then pyrcc5 -o libs/resources.py resources.qrc, python labelImg.py

mkrupczak3 commented 1 year ago

If the pyrcc5 command doesn't work, run the following first: pip install --force-reinstall PyQt5-sip