Question

I am working on python project and I have a problem with pyside-rcc. First, let I explain briefly about my project.

I created my project GUI in QtDesigner and also use the image in the GUI. Then, I generate .py from .ui file using pyside-uic and it works! Then I have to generate my resource file, .qrc file, to .py file to use with my project.

The problem is when I use pyside-rcc to generate a resource file, it shows an error.

"'pyside-rcc' is not recognized as an internal or external command, operable probram or batch file." (As shown below)

A desktop image shows an error when using pyside-rcc

You can see in the bottom of Python folder. There is pyside-rcc.exe file. I do not know why pyside-rcc is not work (pyside-uic still work).

Thank you for answer. :)

Was it helpful?

Solution

The pyside-uic tool is installed into a different folder than the other PySide tools (like pyside-rcc and pyside-lupdate).

To get all the tools working for Python-3.3, your PATH environment variable needs to include these two paths:

    C:\Python33\Lib\site-packages\PySide;C:\Python33\Scripts;

Once you've made the necessary changes, you will also need to re-open any command-prompt windows for the changes to take effect.

OTHER TIPS

or else you could mention full path of pyside-rcc.exe like:

C:/python/lib/../../pyside-rcc.exe -o input.qrc output.py

This is more than likely a PATH problem, but what is odd is that pyside-uic works but pyside-rcc doesn't.

Right click on My Computer and go to Properties. Then click on Advanced System Settings. Under the Advanced tab, click on the "Environment Variables..." button. A new window will open up and you will see a list showing "System variables". Scroll to the "Path" system variable, and either double click it or click the "Edit..." button. At the beginning of the "Variable value:" entry, put in the directory to the folder that contains pyside-rcc.exe and put a semicolon (;) after it, like below:

C:\Path\To\PySideRCC\;C:\Paths\To\Other\Stuff1;C:\Paths\To\Other\Stuff2;C:\Paths\To\Other\Stuff3

Or put the directory at the end, but with the semicolon in front of it (after the last entry). After doing this, you either have to logout and log back in or reboot in order for Windows to recognize the PATH changes. That should do the trick.

You need to set environment path for pyside-rcc to work.

First identify where is python.exe file is stored

Powershell

PS C:> get-command python

Cmd

c:\> where python

Powershell get-command python output on my system

PS C:\> get-command python

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     python.exe                                         3.10.5150… C:\Users\user_name\AppData\Local\Programs\Python\Python310\python.exe

pyside6-rcc.exe and pyside6-uic.exe are present inside C:\Users\user_name\AppData\Local\Programs\Python\Python310\Scripts on my system

Finally Add Path

C:\Users\user_name\AppData\Local\Programs\Python\Python310\Scripts and C:\Users\user_name\AppData\Local\Programs\Python\Python310\Lib\site-packages\PySide6 to the environment path and restart your terminal.

Try new find rcc.exe file:

  • open the Visual Studio 2022 Developer Command Prompt
  • Then cd C:\Python311\Lib\site-packages\PySide6. This this is rcc.exe location on my PC. If your location is different, findthe rcc.exe file and copy the directory location and paste after cd command shown.
  • Then run rcc.exe <file.qrc location><\filename.qrc> -o <output file.py location><\filename.py>

and press enter.

Don't copy and paste this code this is method not complete code ok

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top