Discussion:
[Maya-Python] PySide2/PyQt5 crashes app on error?
Fredrik Averpil
2016-09-29 08:01:28 UTC
Permalink
Not sure if it's just me or if this is a thing.

So, I've noticed that with e.g. Maya 2015 (Qt4) and PySide, when my UI hits
an error and I get the Traceback in the script editor the UI doesn't
crash/disappear. It's still fully functional in Maya as well as when I run
the UI in the cmd/terminal (standalone).

However, with Maya 2017 (Qt5) and PySide2, the application still prints the
traceback in the script editor but then simply crashes.
If I run the UI in cmd/terminal (standalone) instead, the UI disappears as
well.

The error can be e.g. that when I click a pushButton it calls a function
which prints "hello". But in this case let's say the function was
misspelled so when I click the button a non-existing function is called.

Is this something you guys have observed as well -- or could it be
something specific to my code?

Cheers,
Fredrik
--
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+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWM_m%3DrmaUaU%3D4gka1C4q0oH43cqROUgqqV4%2BVRJnB4Hpg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Marcus Ottosson
2016-09-29 08:16:41 UTC
Permalink
I can confirm this on Windows, or at least some odd behavior.

from PySide2 import QtWidgets
def on_pressed():
priknt("world")

button = QtWidgets.QPushButton("Hello")
button.pressed.connect(on_pressed)
button.show()

For me, when pressing the button, the window with the button in it stalls
and doesn’t do or say anything. The GUI is still responsive and works fine.

When I run:

button.close()

The expected exception appears.

# Error: NameError: file <maya console> line 4: global name 'priknt'
is not defined #

But the GUI remains.

The next time I call close(), the GUI closes, and all is well.

This is with a fresh copy of Maya 2017 on Windows 10, all settings default.
​
Post by Fredrik Averpil
Not sure if it's just me or if this is a thing.
So, I've noticed that with e.g. Maya 2015 (Qt4) and PySide, when my UI
hits an error and I get the Traceback in the script editor the UI doesn't
crash/disappear. It's still fully functional in Maya as well as when I run
the UI in the cmd/terminal (standalone).
However, with Maya 2017 (Qt5) and PySide2, the application still prints
the traceback in the script editor but then simply crashes.
If I run the UI in cmd/terminal (standalone) instead, the UI disappears as
well.
The error can be e.g. that when I click a pushButton it calls a function
which prints "hello". But in this case let's say the function was
misspelled so when I click the button a non-existing function is called.
Is this something you guys have observed as well -- or could it be
something specific to my code?
Cheers,
Fredrik
--
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
To view this discussion on the web visit https://groups.google.com/d/
msgid/python_inside_maya/CAD%3DwhWM_m%3DrmaUaU%3D4gka1C4q0oH43cqROUgqqV4%
2BVRJnB4Hpg%40mail.gmail.com
<https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWM_m%3DrmaUaU%3D4gka1C4q0oH43cqROUgqqV4%2BVRJnB4Hpg%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
*Marcus Ottosson*
***@gmail.com
--
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+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmODypNPvuVxOjMFg1QFNtKsHgBubdz3d_WX9RhFn3SNb-Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Fredrik Averpil
2016-10-01 13:43:27 UTC
Permalink
Yes, I see this behavior in both Windows 10 and macOS (Sierra) when using
Maya 2017.

So what's new here in Maya 2017 is the UI completely freezes - when
compared to Maya 2016 where it is completely functional although it casts
an error in the script editor.

This behavior is also the same when running this PySide2 code in the
terminal on macOS. But if you're using PyQt5, the UI completely crashes and
disappears instantly.

Hm.
Post by Marcus Ottosson
I can confirm this on Windows, or at least some odd behavior.
from PySide2 import QtWidgets
priknt("world")
button = QtWidgets.QPushButton("Hello")
button.pressed.connect(on_pressed)
button.show()
For me, when pressing the button, the window with the button in it stalls
and doesn’t do or say anything. The GUI is still responsive and works fine.
button.close()
The expected exception appears.
# Error: NameError: file <maya console> line 4: global name 'priknt' is not defined #
But the GUI remains.
The next time I call close(), the GUI closes, and all is well.
This is with a fresh copy of Maya 2017 on Windows 10, all settings default.
​
Not sure if it's just me or if this is a thing.
So, I've noticed that with e.g. Maya 2015 (Qt4) and PySide, when my UI
hits an error and I get the Traceback in the script editor the UI doesn't
crash/disappear. It's still fully functional in Maya as well as when I run
the UI in the cmd/terminal (standalone).
However, with Maya 2017 (Qt5) and PySide2, the application still prints
the traceback in the script editor but then simply crashes.
If I run the UI in cmd/terminal (standalone) instead, the UI disappears as
well.
The error can be e.g. that when I click a pushButton it calls a function
which prints "hello". But in this case let's say the function was
misspelled so when I click the button a non-existing function is called.
Is this something you guys have observed as well -- or could it be
something specific to my code?
Cheers,
Fredrik
--
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
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWM_m%3DrmaUaU%3D4gka1C4q0oH43cqROUgqqV4%2BVRJnB4Hpg%40mail.gmail.com
<https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWM_m%3DrmaUaU%3D4gka1C4q0oH43cqROUgqqV4%2BVRJnB4Hpg%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
*Marcus Ottosson*
--
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
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/CAFRtmODypNPvuVxOjMFg1QFNtKsHgBubdz3d_WX9RhFn3SNb-Q%40mail.gmail.com
<https://groups.google.com/d/msgid/python_inside_maya/CAFRtmODypNPvuVxOjMFg1QFNtKsHgBubdz3d_WX9RhFn3SNb-Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWOXC3umyEFe1uU%3D02Kpe-Fc-1GEBaFSW2CA-%3Dic_N_-gQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Fredrik Averpil
2016-10-01 13:56:39 UTC
Permalink
So, this definitively seems like some kind of bug to me. I don't want my
application to stall indefinitely on end-users ever. I opened a bug report:
https://bugreports.qt.io/browse/PYSIDE-364

Please add your +1's, comments or ideas to the report. I think this is a
quite severe issue.

I really prefer "nothing happens when I click the button!" instead of "aaaw
f@¢$, I lost all my work!".

Regards,
Fredrik
--
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+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWMaN5s2826iiPes6O-9TktCHRmp37qKnWVUG_J7UKiXeQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
t***@gmail.com
2018-09-01 18:47:30 UTC
Permalink
Was this ever resolved? I'm getting the exact issue trying to import any for of pyside2 gui in maya 2017 macos..
Post by Fredrik Averpil
https://bugreports.qt.io/browse/PYSIDE-364
Please add your +1's, comments or ideas to the report. I think this is a quite severe issue.
Regards,
Fredrik
--
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+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/eb2e1b33-ed1a-43b6-86bb-3a33bac1ca82%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Justin Israel
2018-09-01 19:28:03 UTC
Permalink
Post by t***@gmail.com
Was this ever resolved? I'm getting the exact issue trying to import any
for of pyside2 gui in maya 2017 macos..
Do you get an error simply importing PySide2 in Maya 2017? Because that
wouldn't be the same issue as previously described.
Post by t***@gmail.com
Post by Fredrik Averpil
So, this definitively seems like some kind of bug to me. I don't want my
https://bugreports.qt.io/browse/PYSIDE-364
Please add your +1's, comments or ideas to the report. I think this is a
quite severe issue.
Post by Fredrik Averpil
I really prefer "nothing happens when I click the button!" instead of
Regards,
Fredrik
--
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
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/eb2e1b33-ed1a-43b6-86bb-3a33bac1ca82%40googlegroups.com
.
For more options, visit https://groups.google.com/d/optout.
--
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+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0Jn9uezBU%2BbRzJqYWqYFdCHSf4qTmz94KgmoKe33YC8Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
James Porter
2018-09-01 19:32:49 UTC
Permalink
No. I’m getting an error when ever I try to launch any for of pyside2 guy
in Maya.

I can import pyside, qtcore, qtwidgets shiboken2 etc without any problem
Post by t***@gmail.com
Was this ever resolved? I'm getting the exact issue trying to import any
for of pyside2 gui in maya 2017 macos..
Do you get an error simply importing PySide2 in Maya 2017? Because that
wouldn't be the same issue as previously described.
Post by t***@gmail.com
Post by Fredrik Averpil
So, this definitively seems like some kind of bug to me. I don't want my
https://bugreports.qt.io/browse/PYSIDE-364
Please add your +1's, comments or ideas to the report. I think this is a
quite severe issue.
Post by Fredrik Averpil
I really prefer "nothing happens when I click the button!" instead of
Regards,
Fredrik
--
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
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/eb2e1b33-ed1a-43b6-86bb-3a33bac1ca82%40googlegroups.com
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the
Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/python_inside_maya/U26L1o8ncN4/unsubscribe
.
To unsubscribe from this group and all its topics, send an email to
python_inside_maya+***@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0Jn9uezBU%2BbRzJqYWqYFdCHSf4qTmz94KgmoKe33YC8Q%40mail.gmail.com
<https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0Jn9uezBU%2BbRzJqYWqYFdCHSf4qTmz94KgmoKe33YC8Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CACsi_521OLg9BcG13wYSMzkAA5%3D5rhfm8%3DAzYEQRpLE4vrjjDA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Justin Israel
2018-09-01 19:45:13 UTC
Permalink
Post by James Porter
No. I’m getting an error when ever I try to launch any for of pyside2 guy
in Maya.
I can import pyside, qtcore, qtwidgets shiboken2 etc without any problem
Again, that sounds like a different problem. What was previously described
was the behavior of Qt code that raises exceptions in its logic which are
not caught.

So it is different if you try to launch simply any gui code and it crashes.
What error messages are you seeing?
Post by James Porter
Post by t***@gmail.com
Was this ever resolved? I'm getting the exact issue trying to import any
for of pyside2 gui in maya 2017 macos..
Do you get an error simply importing PySide2 in Maya 2017? Because that
wouldn't be the same issue as previously described.
Post by t***@gmail.com
Post by Fredrik Averpil
So, this definitively seems like some kind of bug to me. I don't want
my application to stall indefinitely on end-users ever. I opened a bug
Post by Fredrik Averpil
https://bugreports.qt.io/browse/PYSIDE-364
Please add your +1's, comments or ideas to the report. I think this is
a quite severe issue.
Post by Fredrik Averpil
I really prefer "nothing happens when I click the button!" instead of
Regards,
Fredrik
--
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
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/eb2e1b33-ed1a-43b6-86bb-3a33bac1ca82%40googlegroups.com
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the
Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/python_inside_maya/U26L1o8ncN4/unsubscribe
.
To unsubscribe from this group and all its topics, send an email to
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0Jn9uezBU%2BbRzJqYWqYFdCHSf4qTmz94KgmoKe33YC8Q%40mail.gmail.com
<https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0Jn9uezBU%2BbRzJqYWqYFdCHSf4qTmz94KgmoKe33YC8Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/CACsi_521OLg9BcG13wYSMzkAA5%3D5rhfm8%3DAzYEQRpLE4vrjjDA%40mail.gmail.com
<https://groups.google.com/d/msgid/python_inside_maya/CACsi_521OLg9BcG13wYSMzkAA5%3D5rhfm8%3DAzYEQRpLE4vrjjDA%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2KiOez2ZN-LeN032Zs3P%3D45M%3DRhj%2BgDxn%3D_m7UsagEVw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
James Porter
2018-09-01 21:49:15 UTC
Permalink
Fair enough, Justin!

I’ll start a new thread with some detailed info!!

Thanks

James
Post by James Porter
No. I’m getting an error when ever I try to launch any for of pyside2 guy
in Maya.
I can import pyside, qtcore, qtwidgets shiboken2 etc without any problem
Again, that sounds like a different problem. What was previously described
was the behavior of Qt code that raises exceptions in its logic which are
not caught.

So it is different if you try to launch simply any gui code and it crashes.
What error messages are you seeing?
Post by James Porter
Post by t***@gmail.com
Was this ever resolved? I'm getting the exact issue trying to import any
for of pyside2 gui in maya 2017 macos..
Do you get an error simply importing PySide2 in Maya 2017? Because that
wouldn't be the same issue as previously described.
Post by t***@gmail.com
Post by Fredrik Averpil
So, this definitively seems like some kind of bug to me. I don't want
my application to stall indefinitely on end-users ever. I opened a bug
Post by Fredrik Averpil
https://bugreports.qt.io/browse/PYSIDE-364
Please add your +1's, comments or ideas to the report. I think this is
a quite severe issue.
Post by Fredrik Averpil
I really prefer "nothing happens when I click the button!" instead of
Regards,
Fredrik
--
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
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/eb2e1b33-ed1a-43b6-86bb-3a33bac1ca82%40googlegroups.com
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the
Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/python_inside_maya/U26L1o8ncN4/unsubscribe
.
To unsubscribe from this group and all its topics, send an email to
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0Jn9uezBU%2BbRzJqYWqYFdCHSf4qTmz94KgmoKe33YC8Q%40mail.gmail.com
<https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0Jn9uezBU%2BbRzJqYWqYFdCHSf4qTmz94KgmoKe33YC8Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/CACsi_521OLg9BcG13wYSMzkAA5%3D5rhfm8%3DAzYEQRpLE4vrjjDA%40mail.gmail.com
<https://groups.google.com/d/msgid/python_inside_maya/CACsi_521OLg9BcG13wYSMzkAA5%3D5rhfm8%3DAzYEQRpLE4vrjjDA%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the
Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/python_inside_maya/U26L1o8ncN4/unsubscribe
.
To unsubscribe from this group and all its topics, send an email to
python_inside_maya+***@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2KiOez2ZN-LeN032Zs3P%3D45M%3DRhj%2BgDxn%3D_m7UsagEVw%40mail.gmail.com
<https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2KiOez2ZN-LeN032Zs3P%3D45M%3DRhj%2BgDxn%3D_m7UsagEVw%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CACsi_51t_V_axTJVAVdt6k8m26A6-JzFp39_trGcy9ssGPckkw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Alexander Morano
2018-09-18 00:23:23 UTC
Permalink
Well, I will bring back the dead, on topic.

I get this, Maya 2018, using PyQt5.

If there is an "exception" in the window, at any time, I get a silent,
immediate crash.

Nothing logged.

Was this ever resolved by anyone (AD, Riverbank, etc....)?

Is this the new behavior to expect with PyQt5 and Maya 2018-> ???

Feels super bad atm.
Post by Fredrik Averpil
So, this definitively seems like some kind of bug to me. I don't want my
https://bugreports.qt.io/browse/PYSIDE-364
Please add your +1's, comments or ideas to the report. I think this is a
quite severe issue.
I really prefer "nothing happens when I click the button!" instead of
Regards,
Fredrik
--
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+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/4241c180-d114-4287-9a8f-e1f329fad643%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
'Michel Satorra' via Python Programming for Autodesk Maya
2018-09-21 21:10:06 UTC
Permalink
Hello,

Same here, trying to change my scripts from pyqt4 to pyqt5 and get maya
crash. I have a stack trace in the terminal but nothing about my script.
I think the bug is still open there :
https://bugreports.qt.io/browse/PYSIDE-478
Post by Alexander Morano
Well, I will bring back the dead, on topic.
I get this, Maya 2018, using PyQt5.
If there is an "exception" in the window, at any time, I get a silent,
immediate crash.
Nothing logged.
Was this ever resolved by anyone (AD, Riverbank, etc....)?
Is this the new behavior to expect with PyQt5 and Maya 2018-> ???
Feels super bad atm.
Post by Fredrik Averpil
So, this definitively seems like some kind of bug to me. I don't want my
https://bugreports.qt.io/browse/PYSIDE-364
Please add your +1's, comments or ideas to the report. I think this is a
quite severe issue.
I really prefer "nothing happens when I click the button!" instead of
Regards,
Fredrik
--
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+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/8c50eea9-aa0f-40c9-93de-b211463a6182%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...