ImportError: No module named 'resource_rc'

前端 未结 2 1230
轻奢々
轻奢々 2020-12-03 19:26

I made a simple program with PyQt GUI, and compiled \'.ui\' file.

# Form implementation generated from reading ui file \'main.ui\'
#
# Created by: PyQt5 UI c         


        
相关标签:
2条回答
  • 2020-12-03 19:43

    When you compile a .ui file, it uses the resources_rc.py (which must be compiled as well) to store its resources. For example, if you open the qrc file, you will see the items it has stored. If your ui uses anything from the resources_rc.py, file you will get the error you saw.

    0 讨论(0)
  • 2020-12-03 19:51

    You should have a file called resource.qrc, this must be converted to .py, this or you can do it by executing:

    pyrcc5 resource.qrc -o resource_rc.py
    
    0 讨论(0)
提交回复
热议问题