I see. I think that's the reason it keeps crashing (?) 
It worked fine when I ran this:
from Qt import QtWidgets

w = QtWidgets.QWidget()
w.show()

Actually I just need this UI file run in maya. Is there anyway to call 
attached files in maya? (I've converted this ui file to python using 
pyuic5). 
I think I need to show the QWidget instead of QApplications(?) by changing 
the last part of this script? 

Thank you! 

On Friday, August 23, 2024 at 11:25:26 AM UTC+9 Justin Israel wrote:

> Ok a few things from your last couple replies. You should not need to 
> install Python or PySide2, as they are already bundled within Maya. You 
> only need to install things if your goal is to run a standalone application 
> that wants to load and use maya.standalone.
>
> The code snippet you are running from within the Maya Script Editor should 
> not be trying to create and start a new QApplication. One is already 
> running for you as the Maya app itself. You only need to create and show 
> the widgets.
>
> On Fri, Aug 23, 2024 at 2:16 PM Yoga Yasahardja <yogayas...@gmail.com> 
> wrote:
>
>> Hi, Justin, Thank you for your reply! 
>>
>> I checked that my maya 2023 used PySide2, I already try installing python 
>> 3.9 and used PySide2 but it didn't work either. 
>> Sorry as I'm new to Qt environment, not sure if I understand your reply 
>> well. 
>>
>> Also, 
>> is there any suggestion what should I use to generate PySide UI 
>> generation you mentioned?
>>
>> Thank you.  
>> On Friday, August 23, 2024 at 11:13:45 AM UTC+9 Yoga Yasahardja wrote:
>>
>>> additionally I can't even run this (screenshot attached). 
>>>
>>> On Friday, August 23, 2024 at 10:53:21 AM UTC+9 Justin Israel wrote:
>>>
>>>> You can't really pick and choose your version of python or PySide vs 
>>>> PyQt. If you are going to run it within Maya, you need to use the version 
>>>> of python and the type of Qt binding that it provides. When you see 
>>>> "shiboken" in the stacktrace, that is telling you that you need to be 
>>>> using 
>>>> PySide2. I see you are also using some generated UI code that came from 
>>>> PyQt5, so that needs to be generated from the pyside UI generation.
>>>>
>>>> On Fri, Aug 23, 2024 at 12:48 PM Yoga Yasahardja <yogayas...@gmail.com> 
>>>> wrote:
>>>>
>>>>> I already try it using python 3.12 and 3.9. Import from PySide2, 
>>>>> PyQt5, from Qt, all same result. 
>>>>>
>>>>> -- 
>>>>> 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/10dcd2e8-c601-439f-b154-faa10b753bfcn%40googlegroups.com
>>>>>  
>>>>> <https://groups.google.com/d/msgid/python_inside_maya/10dcd2e8-c601-439f-b154-faa10b753bfcn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> -- 
>> 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/6b4c3156-62b0-47ee-b69f-39645d1a20f0n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/python_inside_maya/6b4c3156-62b0-47ee-b69f-39645d1a20f0n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/d5a6dbe3-4b0c-4f18-aa92-a54cde75c19cn%40googlegroups.com.
# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'inbetweener.ui'
#
# Created by: PyQt5 UI code generator 5.15.9
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again.  Do not edit this file unless you know what you are doing.


from Qt import QtCore, QtGui, QtWidgets


class Ui_Inbetweener(object):
    def setupUi(self, Inbetweener):
        Inbetweener.setObjectName("Inbetweener")
        Inbetweener.resize(290, 76)
        Inbetweener.setAutoFillBackground(False)
        self.centralwidget = QtWidgets.QWidget(Inbetweener)
        self.centralwidget.setEnabled(True)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.centralwidget.sizePolicy().hasHeightForWidth())
        self.centralwidget.setSizePolicy(sizePolicy)
        self.centralwidget.setMinimumSize(QtCore.QSize(290, 55))
        self.centralwidget.setObjectName("centralwidget")
        self.horizontalLayoutWidget = QtWidgets.QWidget(self.centralwidget)
        self.horizontalLayoutWidget.setGeometry(QtCore.QRect(10, 10, 31, 41))
        self.horizontalLayoutWidget.setObjectName("horizontalLayoutWidget")
        self.hlayout1 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget)
        self.hlayout1.setContentsMargins(0, 0, 0, 0)
        self.hlayout1.setObjectName("hlayout1")
        self.button1 = QtWidgets.QPushButton(self.horizontalLayoutWidget)
        self.button1.setText("")
        self.button1.setObjectName("button1")
        self.hlayout1.addWidget(self.button1)
        self.horizontalLayoutWidget_2 = QtWidgets.QWidget(self.centralwidget)
        self.horizontalLayoutWidget_2.setGeometry(QtCore.QRect(50, 20, 71, 16))
        self.horizontalLayoutWidget_2.setObjectName("horizontalLayoutWidget_2")
        self.hlayout2 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget_2)
        self.hlayout2.setContentsMargins(0, 0, 0, 0)
        self.hlayout2.setObjectName("hlayout2")
        self.button3 = QtWidgets.QPushButton(self.horizontalLayoutWidget_2)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.button3.sizePolicy().hasHeightForWidth())
        self.button3.setSizePolicy(sizePolicy)
        self.button3.setText("")
        self.button3.setObjectName("button3")
        self.hlayout2.addWidget(self.button3)
        self.button2 = QtWidgets.QPushButton(self.horizontalLayoutWidget_2)
        self.button2.setEnabled(True)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.button2.sizePolicy().hasHeightForWidth())
        self.button2.setSizePolicy(sizePolicy)
        self.button2.setText("")
        self.button2.setObjectName("button2")
        self.hlayout2.addWidget(self.button2)
        self.button5 = QtWidgets.QPushButton(self.horizontalLayoutWidget_2)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.button5.sizePolicy().hasHeightForWidth())
        self.button5.setSizePolicy(sizePolicy)
        self.button5.setText("")
        self.button5.setObjectName("button5")
        self.hlayout2.addWidget(self.button5)
        self.button4 = QtWidgets.QPushButton(self.horizontalLayoutWidget_2)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.button4.sizePolicy().hasHeightForWidth())
        self.button4.setSizePolicy(sizePolicy)
        self.button4.setText("")
        self.button4.setObjectName("button4")
        self.hlayout2.addWidget(self.button4)
        self.horizontalLayoutWidget_3 = QtWidgets.QWidget(self.centralwidget)
        self.horizontalLayoutWidget_3.setGeometry(QtCore.QRect(170, 20, 71, 16))
        self.horizontalLayoutWidget_3.setObjectName("horizontalLayoutWidget_3")
        self.hlayout4 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget_3)
        self.hlayout4.setContentsMargins(0, 0, 0, 0)
        self.hlayout4.setObjectName("hlayout4")
        self.button9 = QtWidgets.QPushButton(self.horizontalLayoutWidget_3)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.button9.sizePolicy().hasHeightForWidth())
        self.button9.setSizePolicy(sizePolicy)
        self.button9.setText("")
        self.button9.setObjectName("button9")
        self.hlayout4.addWidget(self.button9)
        self.button10 = QtWidgets.QPushButton(self.horizontalLayoutWidget_3)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.button10.sizePolicy().hasHeightForWidth())
        self.button10.setSizePolicy(sizePolicy)
        self.button10.setText("")
        self.button10.setObjectName("button10")
        self.hlayout4.addWidget(self.button10)
        self.button8 = QtWidgets.QPushButton(self.horizontalLayoutWidget_3)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.button8.sizePolicy().hasHeightForWidth())
        self.button8.setSizePolicy(sizePolicy)
        self.button8.setText("")
        self.button8.setObjectName("button8")
        self.hlayout4.addWidget(self.button8)
        self.button7 = QtWidgets.QPushButton(self.horizontalLayoutWidget_3)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.button7.sizePolicy().hasHeightForWidth())
        self.button7.setSizePolicy(sizePolicy)
        self.button7.setText("")
        self.button7.setObjectName("button7")
        self.hlayout4.addWidget(self.button7)
        self.horizontalLayoutWidget_4 = QtWidgets.QWidget(self.centralwidget)
        self.horizontalLayoutWidget_4.setGeometry(QtCore.QRect(130, 10, 31, 41))
        self.horizontalLayoutWidget_4.setObjectName("horizontalLayoutWidget_4")
        self.hlayout3 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget_4)
        self.hlayout3.setContentsMargins(0, 0, 0, 0)
        self.hlayout3.setObjectName("hlayout3")
        self.button6 = QtWidgets.QPushButton(self.horizontalLayoutWidget_4)
        self.button6.setText("")
        self.button6.setObjectName("button6")
        self.hlayout3.addWidget(self.button6)
        self.horizontalLayoutWidget_5 = QtWidgets.QWidget(self.centralwidget)
        self.horizontalLayoutWidget_5.setGeometry(QtCore.QRect(250, 10, 31, 41))
        self.horizontalLayoutWidget_5.setObjectName("horizontalLayoutWidget_5")
        self.hlayout5 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget_5)
        self.hlayout5.setContentsMargins(0, 0, 0, 0)
        self.hlayout5.setObjectName("hlayout5")
        self.button11 = QtWidgets.QPushButton(self.horizontalLayoutWidget_5)
        self.button11.setText("")
        self.button11.setObjectName("button11")
        self.hlayout5.addWidget(self.button11)
        Inbetweener.setCentralWidget(self.centralwidget)
        self.statusbar = QtWidgets.QStatusBar(Inbetweener)
        self.statusbar.setObjectName("statusbar")
        Inbetweener.setStatusBar(self.statusbar)

        self.retranslateUi(Inbetweener)
        QtCore.QMetaObject.connectSlotsByName(Inbetweener)

    def retranslateUi(self, Inbetweener):
        _translate = QtCore.QCoreApplication.translate
        Inbetweener.setWindowTitle(_translate("Inbetweener", "Inbetweener"))


if __name__ == "__main__":
    import sys
    app = QtWidgets.QApplication(sys.argv)
    Inbetweener = QtWidgets.QMainWindow()
    ui = Ui_Inbetweener()
    ui.setupUi(Inbetweener)
    Inbetweener.show()
    sys.exit(app.exec_())

Reply via email to