Must construct a QApplication before a QWidget
import sys
from PySide6.QtWidgets import QApplication, QMainWindow
from windows.mainWindow import MainWindow
if __name__ == '__main__':
app = QApplication(sys.argv)
window = MainWindow()
window.show()
sys.exit(app.exec())
from PyQt5.QtWidgets import QMainWindow
class MainWindow(QMainWindow):
def __init__(self):
super(MainWindow, self).__init__()
self.setWindowTitle('MainWindow')