I'm new to PySide2 and I'm facing this issue while creating super simple window with PySide2 and Pycharm: Qapplication() error :'NoneType'; both with sys.argv as argument and without any argument the error occur. I'm using mayapy.exe as python interpreter from maya 2022, I'm wondering if someone could give some advice to setup properly Pycharm for PySide2. this is the code i try to run:
from PySide2.QtWidgets import QApplication, QWidget
import sys
class Window(QWidget):
def __init__(self):
super(Window, self).__init__()
self.setWindowTitle("PySide2 app")
self.setGeometry(300,300,300,300)
app = QApplication()
myWindow = Window()
myWindow.show()
app.exec_()
sys.exit(0)
-----------
Error
-----------
Traceback (most recent call last):
File "E:/QtDesigner/pyside2_app.py", line 11, in <module>
app = QApplication()
TypeError: 'NoneType' object is not callable
Thanks for your help!