laptop: MacBook Pro 2015, MacOS Sierra.
Installation:
brew install qt: success
brew install qt4: Error No formulae found in taps
brew install cartr/qt4: success
brew install libxml2: success
brew install pyqt: success
$ make qt4py2
make: * No rule to make target `qt4py2'. Stop.
$ python labelImg.py
python: can't open file 'labelImg.py': [Errno 2] No such file or directory
The current version:
qt 5.9.2 is already installed
libxml2 2.9.6 is already installed
pyqt 5.9_1 is already installed
Is there something missing?
I fixed this issue with the following solution:
1) git clone https://github.com/tzutalin/labelImg.git, and cd labelImg
2) brew install qt
3) brew install cartr/qt4
4) export PYTHONPATH=/usr/local/Cellar/libxml2/2.9.6/lib/python2.7/site-packages:/usr/local/Cellar/sip/4.19.3_4/lib/python2.7/site-packages/:/usr/local/Cellar/pyqt@4/4.12_1/lib/python2.7/site-packages:$PYTHONPATH
5) brew install libxml2
6) sudo easy_install pip
7) sudo pip install lxml (I install it because step 9 show "no module lxml")
8) make qt4py2
9) python labelImg.py
It works very well now.
doesn't work for me, in high sierra
hi, I am facing following issue
$ python labelImg.py
Traceback (most recent call last):
File "labelImg.py", line 27, in
import resources
File "/Users/i303433/labelImg/resources.py", line 9, in
from PyQt4 import QtCore
ImportError: dlopen(/usr/local/Cellar/pyqt@4/4.12_1/lib/python2.7/site-packages/PyQt4/QtCore.so, 2): Symbol not found: _PyInt_Type
Referenced from: /usr/local/Cellar/pyqt@4/4.12_1/lib/python2.7/site-packages/PyQt4/QtCore.so
Expected in: flat namespace
in /usr/local/Cellar/pyqt@4/4.12_1/lib/python2.7/site-packages/PyQt4/QtCore.so
Could you please help me with it
@megha-17 I think that you may create a new issue. Your problem is different from the current issue.
@zhihongzeng2002 , Actually I am also trying to install labelImg on my mac osx and have followed solution provided by you to install but it is not working and facing following issue:-
$ python labelImg.py
Traceback (most recent call last):
File "labelImg.py", line 27, in
import resources
File "/Users/i303433/labelImg/resources.py", line 9, in
from PyQt4 import QtCore
ImportError: dlopen(/usr/local/Cellar/pyqt@4/4.12_1/lib/python2.7/site-packages/PyQt4/QtCore.so, 2): Symbol not found: _PyInt_Type
Referenced from: /usr/local/Cellar/pyqt@4/4.12_1/lib/python2.7/site-packages/PyQt4/QtCore.so
Expected in: flat namespace
in /usr/local/Cellar/pyqt@4/4.12_1/lib/python2.7/site-packages/PyQt4/QtCore.so
@megha-17
Here is my work env. You may check your work env or use python virtualenv (I tested) to repeat my work env. Good luck.
laptop: MacBook Pro 2015, MacOS high Sierra version 10.13.1 which was updated yesterday (I don't think it would matter)
python 2.7.10.
$brew install cartr/qt4/qt@4
qt@4 4.8.7_2 is already installed
$brew install cartr/qt4/qt-legacy-formula
cartr/qt4/qt-legacy-formula 999.0.0 is already installed
$brew install cartr/qt4/pyqt@4
pyqt@4 4.12_1 is already installed
$pip install lxml
Requirement already satisfied: lxml in /Library/Python/2.7/site-packages
$brew install libxml2
libxml2 2.9.6 is already installed
$git clone https://github.com/tzutalin/labelImg.git
$cd labelImg
$make qt4py2
pyrcc4 -py2 -o resources.py resources.qrc
$python labelImg.py
It works fine.
Hey, this worked for me:
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]
Doesn't work for me on latest macOS.
pyrcc4 -py2 -o resources.py resources.qrc
Segmentation fault: 11
A possible thing happening is that you're not using Qt-5 with Python 3 or Qt-4 with Python 2.
What Python version are you using? Can you share your output from qmake --version? @aysark
Frankly i just gave up since it was taking way too long to bootstrap it, i downloaded this packaged version of labelmg:
https://github.com/jiyeqian/labelImg/releases/download/1.4.4-pre/labelImg_qt5py3_mac_latest.zip
A better solution! 😃 👍
Hope this https://github.com/tzutalin/labelImg/issues/202 will help, it works for my case.
@aysark
You, sir, just made my day. Thanks
@aysark You saved my day. Thanks a ton.
@aysark Most elegant solution, ever ;-)
when compile, i meet this:
➜ labelImg git:(master) make qt5py3
pyrcc5 -o resources.py resources.qrc
make: pyrcc5: No such file or directory
@aysark thx, Man ~
this app is very Cool ~ it dont need compile .
This issue appears to be resolved. @wxianfeng Please open a separate issue if necessary.
Thanks,
-Vlad
I used a combo (High Sierra)
already had python 3.x and python 2.x
1.- git clone https://github.com/tzutalin/labelImg.git
2.- cd labelImg
3.- brew install qt
4.- brew install cartr/qt4/qt@4
5.- brew install libxml2
6.- make qt5py3
7.- python3 labelImg.py (used python3 !!)
8.- I used the application file explorer to choose the folder
@aysark has got the goods!
pip3 install pyqt5 lxml
The above command seems to fix the following error:
make: pyrcc5: No such file or directory
Reference : https://pypi.org/project/labelImg/
same issue with pyrcc5: No such file or directory
missing pyrcc is because pyqt5 is not installed properly.
If you are using mac, try $ pip install pyqt5 lxml. Or else you can check out how I set up for build machine
https://github.com/tzutalin/labelImg/blob/master/.travis.yml#L78
pyqt5 is in place but pyrcc5 is missing anyways. Any thoughts?
Summary
MacOS: QT5 + Python3
pip3 install pyqt5 lxml
make qt5py3
python3 labelImg.py
Build an App:
python3 setup.py py2app -A
sudo mv dist/labelImg.app /Applications/
As I mentioned "pyqt5 is in place".
$ python3 -c "from PyQt5.QtCore import *; import lxml"
$
$make qt5py3
pyrcc5 -o libs/resources.py resources.qrc
make: pyrcc5: No such file or directory
make: *** [qt5py3] Error 1
Most helpful comment
Frankly i just gave up since it was taking way too long to bootstrap it, i downloaded this packaged version of labelmg:
https://github.com/jiyeqian/labelImg/releases/download/1.4.4-pre/labelImg_qt5py3_mac_latest.zip