Labelimg: My install tip for OSX/Ubuntu

Created on 9 Aug 2017  路  13Comments  路  Source: tzutalin/labelImg

  • OS : Sierra 10.12.6
  • PyQt version: 4
  • python 2.7

As osx user, it was very tough to install this lableImg tool on OSX, especially install pyqt4 on python 2.7. In my case, I used conda rather than local env. What I did is below.

  • create conda env using python 2.7
conda create -n py2 python=2.7
source activate py2
  • install necessary libs using conda install
conda install pyqt=4
conda install libxml2
conda install lxml
  • do as describe on README.
make qt4py2
python labelImg.py

good luck guys.

**add comment about ubuntu

This way also works on Ubuntu 16.04 & Python 2.7.

Most helpful comment

Download labelImg_qt5py3_mac_latest.zip, and change the "predefined_classes.txt" within "labelImg.app/Contents/MacOS/data". @592692070

All 13 comments

Thanks for sharing you experience. I followed your tips, but it doesn't work. And the error is "Segmentation fault: 11".

Can you help me ?

Download labelImg_qt5py3_mac_latest.zip, and change the "predefined_classes.txt" within "labelImg.app/Contents/MacOS/data". @592692070

Thanks a lot!

I followed your instructions but at the end I am getting error
make qt4py2
make: * No rule to make target `qt4py2'. Stop.

@raut-madhura
check your python version 2.7 on conda.

Thanks for all you guys. I changed python 3 on conda, and it works fine.

@592692070 how you changed from python2 to python3 in anaconda?

I am still getting make: * No rule to make target `qt4py2'. Stop. and i followed the instructions exactly.

@jiyeqian what do you mean by change the predefined classes txt file? I keep getting the error make:** No rule to make target 'qt4py2' i really want to use this tool but im starting to give up

Is there a way to use easy_install setup on MAC

I keep getting the following error. Please advice

administrators-MacBook-Pro:labelImg-master amit.sood$ brew install qt

Warning: qt 5.10.0_1 is already installed

administrators-MacBook-Pro:labelImg-master amit.sood$ brew install libxml2

Warning: libxml2 2.9.7 is already installed

administrators-MacBook-Pro:labelImg-master amit.sood$ make qt5py3

pyrcc5 -o resources.py resources.qrc

administrators-MacBook-Pro:labelImg-master amit.sood$ python labelImg.py

Traceback (most recent call last):
  File "labelImg.py", line 1353, in <module>
    sys.exit(main(sys.argv))
  File "labelImg.py", line 1349, in main
    app, _win = get_main_app(argv)
  File "labelImg.py", line 1342, in get_main_app
    'data', 'predefined_classes.txt'))
  File "labelImg.py", line 399, in __init__
    self.filePath = ustr(defaultFilename)
  File "/Users/amit.sood/Documents/Analytics/github/labelImg-master/libs/ustr.py", line 7, in ustr
    from PyQt4.QtCore import QString
ImportError: No module named PyQt4.QtCore
administrators-MacBook-Pro:labelImg-master amit.sood$ 

@amitsood
As your console message, you did not use conda(aka "Anaconda") and follow my comment.
Check how to use conda env and try again.
I use MacOS and Ubuntu. It should work find as my comment.
Good luck!

@raut-madhura and @greenCyber11, you need to be in the labelImg folder for the make command to work.

Was this page helpful?
0 / 5 - 0 ratings