6

I'm trying to install lalbelImg for The Tensorflow Object Detection API.

Everything is going well until I try to run the command:

pyrcc5 -o libs/resources.py resources.qrc

It give me error:

'pyrcc5' is not recognized as an internal or external command,
 operable program or batch file.

I'm on Windows 10 and have Python 3.5.4

I'm following the tutorial for windows on tzutalin's Github.

Link: https://github.com/tzutalin/labelImg#user-content-windows

PS: I don't use Anaconda.

Christoph Rackwitz
  • 11,317
  • 4
  • 27
  • 36
code lover
  • 151
  • 1
  • 2
  • 9

12 Answers12

6

What worked for me is to be in my activated conda environment and install pyqt5-tools

(labelimg) C:\Users\user>pip install pyqt5-tools

then cd to the labelimg folder

(labelimg) C:\Users\user>cd C:\Users\user\labelimg

then both of these worked

(labelimg) C:\Users\user\labelImg>pyrcc5 -o resources.py resources.qrc

(labelimg) C:\Users\user\labelImg>pyrcc5 -o libs/resources.py resources.qrc

I got this solution by following some advice in this forum https://github.com/heartexlabs/labelImg/issues/971

Olivia Halma
  • 61
  • 1
  • 1
  • This should be marked as the answer. It does necessary operations by no interventions into environment variables., I don't understand why "dpapadopoulos" have mentioned not answer to the question. Thanx @Olivia Halma – Harish Patil Aug 09 '23 at 10:04
5

Turns out I have to give the full directories.

C:\Python35\Scripts\pyrcc5 -o C:\Desktop\labelImg\libs\resources.py C:\Desktop\labelImg\resources.qrc

Copy Paste that and change the directories if needed.

Have an awesome day! - CodeLover

code lover
  • 151
  • 1
  • 2
  • 9
3

This Worked for me

"C:\Users\Saran\anaconda3\Library\bin\pyrcc5.bat" -o libs/resources.py resources.qrc
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Oct 02 '22 at 07:20
1

That means you didn't specify the path

To set the path

Search for edit environment variable -> environment variable -> new -> here add path of that

This error occurred when path is not specified

Suraj Virkar
  • 511
  • 1
  • 4
  • 13
0

Not a Problem

Just find the pyrcc5.exe file from your search bar then copy it and paste it in your labelimg folder or where you have downloaded all other files from github

0

copy the path of labelimg extracted file and paste it in anaconda prompt. e.g

(base) C:\Windows\system32>cd C:\Users\sadda\Desktop\labelImg-master

this is the path of the labelimg : cd C:\Users\sadda\Desktop\labelImg-master

then, copy and paste the : pyrcc5 -o libs/resources.py resources.qrc

C:\Users\sadda\Desktop\labelImg-master>pyrcc5 -o libs/resources.py resources.qrc

saddam
  • 1
  • 1
0

The following code worked for me. Try to find the location of pyrcc5 file, resources.py and resources.qrc file then change it according to your location.

C:\Users\lenovo\miniconda3\envs\labelme\Scripts\pyrcc5.exe -o
F:\labelmg_master\labelImg\venv\Lib\site-packages\pip\_vendor\distlib\resources.py
F:\labelmg_master\labelImg\resources.qrc
Julia Meshcheryakova
  • 3,162
  • 3
  • 22
  • 42
ASIF
  • 1
  • 2
0

if you are using anaconda, download PyQt library using below command
conda install pyqt=5
Go to the labelImg folder and use the following command (replace your user name in the drive) C:\Users\vigneh\anaconda3\pkgs\pyqt-5.9.2-py39hd77b12b_6\Library\bin\pyrcc5 -o resources.py resources.qrc

0

In my case I was trying to use pyrcc5 outside of the virtual environment PyQt5 was installed in.

lli45
  • 11
  • 2
0

I experienced the same error. I opened the labelimg folder in cmd and used ./pyrcc5 -o libs/resources.py resources.qrc . It worked for me.

0

Solution : In Windows: I have supposed, you installed the pyqt5 in the terminal now what you can do that make go the file where the pyrcc in my case: C:\Users\dip\AppData\Local\Programs\Python\Python39\Lib\site-packages\PyQt5\pyrcc.pyd

Now open the folder where the file qrc is present. Make a shortcut file using Right Click -> New -> Shortcut

Browse them C:\Users\dip\AppData\Local\Programs\Python\Python39\Lib\site-packages\PyQt5\pyrcc.pyd

Now this make shortcut for easy Work in that particular folder Now open the terminal in the that folder where the qrc is present and type

     pyrcc icons.qrc -o icon_qrc.py

Cheers!

0

This works for me in Windows without env.

  1. PowerShell: pip install PyQt5
  2. PowerShell: pip install lxml
  3. PowerShell: go to the labelImg directory (example: C:\labelImg-master\)
  4. Windows: Search for directory of file pyrcc5.ex (example: C:\Users\Home\AppData\Roaming\Python\Python310\Scripts\pyrcc5.exe)
  5. PowerShell: C:\Users\Home\AppData\Roaming\Python\Python310\Scripts\pyrcc5.exe -o libs/resources.py resources.qrc
  6. PowerShell: python labelImg.py
Destroy666
  • 892
  • 12
  • 19
Ngan Le
  • 1
  • 1