pyside2 standalone/maya app

73 views
Skip to first unread message

Rudi Hammad

unread,
Sep 1, 2019, 6:29:44 AM9/1/19
to Python Programming for Autodesk Maya
Hello,
I think this might be my pycharm configuration, but I am trying to run a UI both in maya and pycharm by doing:

import sys
from PySide2.QtWidgets import QApplication, QLabel

if __name__ == "__main__":
    app
= QApplication(sys.argv)
    label
= QLabel("aight?")
    label
.show()
    app
.exec_()
else:
    label
= QLabel("aight?")
    label
.show()

When importing in maya ir works, but when testing it in pycharm I am getting the error:
app = QtWidgets.QApplication(sys.argv)
TypeError: 'NoneType' object is not callable

I have googled for a couple of hours, but I don't find a solution.
Thanks

R

Justin Israel

unread,
Sep 1, 2019, 4:15:49 PM9/1/19
to python_in...@googlegroups.com
Your error doesn't exactly match the syntax of your code, but could it be caused by PyCharm being set up to point at PySide2 stubs instead of the actual PySide2 install? Not alot else to go on here. You should check the source python paths you are using in your PyCharm python interpreter configuration. And you could also print QtWidgets module after you import it to confirm which location you are picking up. 


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/573f78fd-f8e4-4979-bc70-0e86101d7ccf%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages