[PyQt] import ui_rc

simozack simozack at yahoo.it
Wed Feb 4 09:06:02 GMT 2009


2009/2/4, Yusuf X <ys1382 at gmail.com>:

> I have one question: when I run pyuic4 on a .ui file that has a QMainWindow,
> it adds "import ui_rc" at the end of the resultant .py file. Then when I use
> that .py file, I get "ImportError: No module named ui_rc". If I delete that
> last line by hand, the .py works fine and I can display the window as
> needed.

Probably you are using a resources file (for example for icons). You
can resolve the issue by creating the resource file in this way:

pyrrc4 file_name.rc > ui_rc.py

HTH,
Simone


More information about the PyQt mailing list