code lover
code lover

Reputation: 149

labelImg: 'pyrcc5' is not recognized as an internal or external command

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.

Upvotes: 6

Views: 38699

Answers (12)

Olivia Halma
Olivia Halma

Reputation: 71

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

Upvotes: 7

Ngan Le
Ngan Le

Reputation: 1

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

Upvotes: 0

Superman_Shield
Superman_Shield

Reputation: 41

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!

Upvotes: 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.

Upvotes: 0

lli45
lli45

Reputation: 11

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

Upvotes: 0

vignesh kannaa
vignesh kannaa

Reputation: 1

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

Upvotes: 0

ASIF
ASIF

Reputation: 1

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

Upvotes: 0

Saran_StackOverflow
Saran_StackOverflow

Reputation: 31

This Worked for me

"C:\Users\Saran\anaconda3\Library\bin\pyrcc5.bat" -o libs/resources.py resources.qrc

Upvotes: 3

saddam
saddam

Reputation: 1

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

Upvotes: 0

UNMILON PAL
UNMILON PAL

Reputation: 1

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

Upvotes: 0

Suraj Virkar
Suraj Virkar

Reputation: 531

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

Upvotes: 1

code lover
code lover

Reputation: 149

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

Upvotes: 4

Related Questions