0

I am trying to install labelImg using setup.py. I run the command:

sudo python3 setup.py install

to install it and everything seemed to be fine. Unfortunately when I tried to execute the program (just tried labelImg &) got an import error:

ImportError: No module named 'resources'

So, I was wondering if I did something wrong or if there something I could do to fix it. My first thought is to provide an absolute import path to resources (and to the following libs imports) but that does not seem the right thing to do. Also it might work for a small project but it's obvious out of reach for a big one.

The git repo seem to imply that I should run it via python, but why then a setup.py exists?

I know I can use the program via python or even install it via PyPI but I am not interested in that.

2
  • Did you follow the installation instructions? Commented Jul 11, 2018 at 7:04
  • Yes I did. I can run the program via python3 just fine. Commented Jul 11, 2018 at 7:08

1 Answer 1

1

The labelImg project depends on other libraries to work such as pyqt5-dev-tools and lxml.

If you check their documentation, first you have to install pyqt5-dev-tools:

 sudo apt-get install pyqt5-dev-tools

Then install lxml:

sudo pip3 install lxml

After that you have to run the make command in order to build the pyqt5-dev-tools library so that the python code can use it properly (make is used to build executable libraries and programs from source code):

 make qt5py3

And finally you can run python3 labelImg.py and use labelImg.

Sign up to request clarification or add additional context in comments.

5 Comments

I installed lxml but as expected the import error remains.
Now I noticed that there's an installation instructions, you have to run make. Try following the steps
What do you mean by make?
I edited my answer and included a clarification about make, please check.
Well, it didn't work. I have tried make also. The problem is with local modules/libraries so it would be unlikely qt5py3 to cause trouble anyway.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.