Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while using pyrcc5

I'm trying to create a resource file for the GUI i'm creating with PyQt 5.

I've used the command line

pyrcc5 -o image_rc.py D:\MyFolder\resource_file.qrc

but i get an error message : No resources in resource description

This is how my resource file looks :

<!DOCTYPE RCC>
<RCC>
    <qresource prefix="/images">
        <file alias="img">Images\mypic.png</file>
    </qresource>

</RCC>

I've followed this topic : python 3 how to put pics inside my program but i somehow have something wrong.

QUESTION : if i understand, when you have a resource file, you still need to have the images in a folder somewhere. So why bother making a resource file then ? Isn't the same ? The images can still be deleted or moved no ?

like image 344
guy16 Avatar asked Sep 27 '22 17:09

guy16


1 Answers

For anyone facing this issue in the future, here is how I solved it.

find the following batch file : pyuic5.bat

Which is a batch file, Edit it to add your own .ui file:

@"C:\Users\******\AppData\Local\Programs\Python\Python35-32\python" -m PyQt5.uic.pyuic %1 %2 %3 %4 %5 %6 %7 %8 %9 Design.ui -o Design.py

pause

Hit enter in the CMD, then the "Design.py" will be created in the folder.

Good Luck.

like image 186
Saeed I Avatar answered Oct 27 '22 09:10

Saeed I