Tuesday, April 30, 2024
HomePythonImportError: No module named resource_rc

ImportError: No module named resource_rc


Hello there people. How are you? Not too long ago I used to be utilizing Qt Designer to design a GUI for one in every of my apps. After doing all of the designing I saved my ui file and ran pyuic4 over it. Every thing labored superb and I had a Python ui file created in my system. However after I tried to run the Python ui file I used to be confronted with an error. It learn one thing like this:

ImportError: No module named resource_rc

So what was the issue? After performing some analysis I noticed {that a} resource_rc file was referenced in my Python ui file however I used to be not capable of finding that resource_rc file wherever in my system. However there was a .qrc file which I had not seen earlier than.

After looking out a bit I got here to know that the .qrc file was a useful resource file of the Qt Designer. At that second I got here to know what the issue was. I had not transformed the .qrc file into Python. The issue was arduous to seek out as a result of there was not a single useful error which clearly acknowledged that I had not transformed the useful resource file into Python. I solved the issue by operating this command:

pyrcc4 -o App/ui/resources_rc.py App/assets.qrc

The above command runs the PyQt useful resource compiler which was already put in with PyQt4 on my Ubuntu laptop computer. pyrcc4 then compiles the useful resource file into Python which might simply be imported and utilized in Python. That resolution solved my drawback.

In order that was it. I hope that this submit was useful for you. With a view to keep up to date with my future posts then don’t overlook to observe me on Twitter, Fb and this weblog. Keep tuned for my subsequent submit which goes to be a e-book giveaway. Goodbye!



RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments