hope you are having a nice day.
I am making small PyQt window widget, before adapting it on my main window widget
this is my code,
import sys from PyQt5 import QtWidgets, uic class Ui(QtWidgets.QMainWindow): def __init__(self): super(Ui, self).__init__() # Call the inherited classes __init__ method uic.loadUi('untitled.ui', self) # Load the .ui file self.show() app = QtWidgets.QApplication(sys.argv) window = Ui() app.exec_()
copied from tutorial site. However, it gives me this error message,
Traceback (most recent call last): File "path/student.py", line 18, in <module> window = Ui() File "path/student.py", line 14, in __init__ qt.uic.loadUi('untitled.ui', self) # Load the .ui file AttributeError: module 'PyQt5' has no attribute 'uic'
I am wondering why this is not working I tried to uninstall and install PyQt5. And weirdly, my main form, which use the same library, works the same. I checked the interpreter but both code works with the same interpreter.