With Qt Creator I created a .ui
file and set the main window icon referred to a .ico
in res.qrc
file.
Then in PyCharm I used pyuic
&pyrcc
to convert qt files to .py
files.
However after I start up my app, I got an import error saying that No module named res_rc
in converted ui.py.
I don't know why this time I got the import error. Before today I could really use res_rc.py
in my severval pyqt5 examples .
Did I miss something that vital ?
Asked
Active
Viewed 181 times
0

Lisen
- 168
- 1
- 2
- 11
2 Answers
0
It seems that files like res_rc.py
and ui.py
should be in the same folder with app.py
and now it works fine.
Previously I put res_rc.py
and ui.py
in a sub folder

Lisen
- 168
- 1
- 2
- 11
0
ui is looking for your res_rc.py in the root folder and you may have saved it somewhere else. There are 2 solutions: move the file to the root of the program or in the ui.py file change the import to "yourmodule.res_rc.py'

papadulo
- 3
- 2