2

I'm having trouble removing a resource file in a pyqt document, I'm also using monkeystudio IDE. I madea program with images and all linked to a resource file called "resources.qyc" and now I get the error

Traceback (most recent call last):
  File "main.py", line 9, in <module>
    from Login import Login
  File "J:\Newone\Login.py", line 3, in <module>
    import mainwindow
  File "J:\Newone\mainwindow.py", line 2, in <module>
    import Addcadet
  File "J:\Newone\Addcadet.py", line 6, in <module>
    ( Ui_Addcadet, QDialog ) = uic.loadUiType( 'Addcadet.ui' )
  File "C:\Python32\lib\site-packages\PyQt4\uic\__init__.py", line 203, in loadUiType
    exec(code_string.getvalue(), ui_globals)
  File "<string>", line 179, in <module>
ImportError: No module named resources_rc
0

1 Answer 1

2

You'll first have to compile the resource file using pyrcc4. You'll run something like this from command line:

pyrcc4 ResourceFile.qrc -o ui_ResourceFile.py
Sign up to request clarification or add additional context in comments.

3 Comments

@user2219834 You execute it from your shell, ResourceFile.qrc is the name of the input file and ui_ResourceFile.py the name of the output file. When you import the resources you'll use the last one, somthing like import ui_ResourceFile. ps: Perhaps it's a typo, but the proper extension for resource files is .qrc
Sorry for sounding stupid, but you can't simply type it into the shell? and which shell?
That depends on your OS. If it is Windows that you are using cmd.exe, otherwise it's probably bash

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.