Cannot use 'pyside-rcc' to compile .qrc file
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)
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. 🙂
Answers:
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:PathToPySideRCC;C:PathsToOtherStuff1;C:PathsToOtherStuff2;C:PathsToOtherStuff3
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.
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:Python33Libsite-packagesPySide;C:Python33Scripts;
Once you’ve made the necessary changes, you will also need to re-open any command-prompt windows for the changes to take effect.
or else you could mention full path of pyside-rcc.exe like:
C:/python/lib/../../pyside-rcc.exe -o input.qrc output.py
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:Usersuser_nameAppDataLocalProgramsPythonPython310python.exe
pyside6-rcc.exe and pyside6-uic.exe are present inside C:Usersuser_nameAppDataLocalProgramsPythonPython310Scripts
on my system
Add C:Usersuser_nameAppDataLocalProgramsPythonPython310Scripts
and C:Usersuser_nameAppDataLocalProgramsPythonPython310Lib
to the environment path and restart your terminal.
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)
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. 🙂
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:PathToPySideRCC;C:PathsToOtherStuff1;C:PathsToOtherStuff2;C:PathsToOtherStuff3
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.
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:Python33Libsite-packagesPySide;C:Python33Scripts;
Once you’ve made the necessary changes, you will also need to re-open any command-prompt windows for the changes to take effect.
or else you could mention full path of pyside-rcc.exe like:
C:/python/lib/../../pyside-rcc.exe -o input.qrc output.py
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:Usersuser_nameAppDataLocalProgramsPythonPython310python.exe
pyside6-rcc.exe and pyside6-uic.exe are present inside C:Usersuser_nameAppDataLocalProgramsPythonPython310Scripts
on my system
Add C:Usersuser_nameAppDataLocalProgramsPythonPython310Scripts
and C:Usersuser_nameAppDataLocalProgramsPythonPython310Lib
to the environment path and restart your terminal.