Labelimg: Cannot install on macOS High Sierra if I use qt4 and make qt4py2

Created on 12 Dec 2017  路  10Comments  路  Source: tzutalin/labelImg

Hello guys.Just to let you know that the installation for macOS is not working as described.
1.The qt4 is missing...I get this error in brew: Error: No available formula with the name "qt4"
2.Since qt4 is missing and cannot be installe via homebrew - this is not working also "make qt4py2".

To get it working on macOS I had to install qt5 and instead of using "make qt4py2" I have used "make qt5py3" and this solved the issue.Please change the this in the description for the installation,because I am pretty sure that there will be people banging their heads right now...
Thanks.
Kind Regards,
IAvor Kolev

Most helpful comment

This worked for me on OSX High Sierra:

$ virtualenv -p python3 labelimg
$ source labelimg/bin/activate
(labelimg) $ pip install PyQt5
(labelimg) $ pip install lxml
(labelimg) $ python labelImg.py

All 10 comments

Thanks ! Qt5 installation is working instead of QT4, on macOS High Sierra.
In the main time, modification on the script /libs/ustr.py seams to be mandatory in this case, as QT5 does not have QTString (it returns directly a python string).
kind regards

I still get the error on High Sierra:
make: * No rule to make target `qt5py3'. Stop.

After cloning the repo from git and cd into it, it's possible to run the 'make qt5py3'. However, then I get the error: No module named 'lxml' when I run python labelImg.py or python3 labelImg.py...

Did anyone experience the same? I do have lxml installed :-(...

Hey @IAvor, @titanbender, this worked for me:

Python 3 + Qt5 (Works on macOS High Sierra)

brew install qt  # will install qt-5.x.x
brew install libxml2
make qt5py3
python labelImg.py
python  labelImg.py [IMAGE_PATH] [PRE-DEFINED CLASS FILE]

Thanks for the note @RodolfoFerro!
I'm not sure why, but I still get the same error message:
"make: * No rule to make target `qt5py3'. Stop."
This happens for the command: "make qt5py3"...

Looks like it is a dependencies problem.
Are you using brew to manage the dependencies @titanbender?

To install qt5 with brew:
brew install qt5

You can also try to reinstall libxml2. The following link might be useful for that:
https://stackoverflow.com/questions/11054972/homebrew-install-libxml2-with-python-modules

Thanks @RodolfoFerro - it worked out perfectly after lxml was installed directly.

Nice!
How did you install lxml @titanbender?

This worked for me on OSX High Sierra:

$ virtualenv -p python3 labelimg
$ source labelimg/bin/activate
(labelimg) $ pip install PyQt5
(labelimg) $ pip install lxml
(labelimg) $ python labelImg.py

This issue appears to have been resolved.

Thanks @tleyden , I have tried many ways, only your method works.

Was this page helpful?
0 / 5 - 0 ratings