9

I'm working on a machine learning assignment. By the when I was trying to install the following file

brew install qt qt5
brew install libxml2
make qt5py3
python labelImg.py
python  labelImg.py [IMAGE_PATH] [PRE-DEFINED CLASS FILE]

at make qt5py3 the output from terminal is make: *** No rule to make target 'qt5py3'. Stop

I'm using OsX high sierra with default terminal Does anyone know just what's happened?

JameS
  • 231
  • 1
  • 2
  • 11

6 Answers6

18

To get the labelImg package (from the link you gave) working on OSX High Sierra, I needed to do the following.

First installed the missing lxml dependency using the solution in this answer

Also

brew install qt qt5
brew install libxml2
brew install pyqt5

After installing pyqt5, ensure that pyrcc5 can be run from the command line.

Download and unzip the labelImg .zip file from the link, and cd into the unzipped folder. Then

make qt5py3

When trying to run, I found it necessary to simplify the libs/usty.py file to remove the PyQt4 dependency. I just changed it to:

import sys
def ustr(x):
    return x

At this point I can run the program with

python labelImg.py

Hope this is useful.

AS Mackay
  • 2,831
  • 9
  • 19
  • 25
  • What did you say in this? Please explain for the understanding. But it really worked for me. – Asim Khan Jul 08 '18 at 09:03
  • AS Mackay, I did what you say, but when a run "pytohn labelImg.py" appears this "Traceback (most recent call last): File "labelImg.py", line 24, in from PyQt4.QtGui import * ImportError: No module named PyQt4.QtGui" How to install PyQt4.QrGui? – GustavoSevero Mar 24 '22 at 14:26
10

For me, I have occurred the same problem (MacOS version 10.13.4 and python 3.7) and solved using below steps.

  1. Unzip the labelImg downloaded from here, cd labelImg-master
  2. brew install qt qt5 brew install libxml2 brew install pyqt5

  3. make qt5py3

  4. python3 labelImg.py
ceekay
  • 1,136
  • 13
  • 11
2

you should download the project from github and enter the folder where file "makefile" is in,

then run make qt5py3

xiadeye
  • 441
  • 1
  • 3
  • 8
  • I get this error pyrcc5 -o resources.py resources.qrc Traceback (most recent call last): File "/Users/rafikgouiaa/anaconda3/bin/pyrcc5", line 7, in from PyQt5.pyrcc_main import main File "/usr/local/lib/python2.7/site-packages/PyQt5/pyrcc_main.py", line 21, in from PyQt5.QtCore import PYQT_VERSION_STR, QDir, QFile ImportError: dlopen(/usr/local/lib/python2.7/site-packages/PyQt5/QtCore.so, 2): Symbol not found: _PyClass_Type Referenced from: /usr/local/lib/python2.7/site-packages/PyQt5/QtCore.so Expected in: flat namespace make: *** [qt5py3] Error 1 – LearnToGrow Mar 23 '18 at 01:28
1

on Macbook

open terminal at folder "labelimg" run: make qt5py3

gshoanganh
  • 137
  • 1
  • 3
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/31202391) – Robert Mar 07 '22 at 23:42
0

Came across this post (and maybe 30 others) while trying to install labelImg.

This gentleman's solution (from the beginning) finally allowed me to get started:

First, install Mini Conda (https://conda.io/docs/user-guide/install/macos.html), and open a new terminal window.

cd labelImg  
conda create -n py2 python=2.7  
source activate py2  
conda install pyqt=4  
conda install libxml2  
conda install lxml  
make qt4py2  
python labelImg.py  

https://gist.github.com/plopd/487f2caf2f983abc990987b97a8a734b

Jason Roman
  • 8,146
  • 10
  • 35
  • 40
0

brew install qt qt5

downloaded and extracted zip file from https://github.com/tzutalin/labelImg

make qt5py3 after running this command i got an error stating "No module found pyqt5";

pip install pyqt5

run

python labelImg.py