Search code examples
pythonpyqtpysidemaya

PySide2 in Maya - 'module' object has no attribute 'QPushButton'


guys! Trying to learn so PySide for Maya 2017 and from first step it was already a bit frustrating.

from PySide2 import QtGui

button = QtGui.QPushButton()
  • 'module' object has no attribute 'QPushButton' Anybody knows something about it ?

Solution

  • Try this method:

    from PySide2.QtWidgets import * 
    
    button = QPushButton("Hello World") 
    button.show()
    

    enter image description here