Houdini 16 crashes on importing PySide

   5385   5   2
User Avatar
Member
2 posts
Joined: Oct. 2009
Offline
When you try importing PySide into Houdini 16, Houdini simply crashes. Now, this isn't really a problem, as Houdini 16 uses PySide2, and importing that works just fine.

But, we wanted to try to use Qt.py, which is a wrapper that let's you write Python Qt code compatible with PyQt4, PyQt5, PySide and PySide2. ( https://github.com/mottosso/Qt.py [github.com] ), and it too crashes when you import it.

Even doing the following crashes Houdini:

try:
import PySide
except ImportError:
import PySide2

By comparison, if I try to import PySide into Maya 2017, which also usese PySide2, it just gives an error that the module does not exist.

It's not a huge problem, but it would be nice to be able to write PySide dialogs that are compatible with Maya 2016 (Qt4), Maya 2017 (Qt5) and Houdini 16.

(I tested this with Houdini 16.0.504.20 on Ubuntu 14.04)
User Avatar
Staff
1255 posts
Joined: July 2005
Offline
That sounds about right.

PySide is built against Qt4 while Houdini is built against Qt5. So importing PySide won't raise an ImportError since PySide can actually be found in the module search path. What happens is that PySide imports and then tries to load its Qt4 dependencies into the application which immediately conflicts with Houdini's Qt5 libraries and boom!

Strange though that Qt.py crashes when you import that module. Perhaps Qt.py tries to import PySide first before PySide2? Have you tried setting
QT_PREFERRED_BINDING=PySide2
in your environment before launching Houdini? That will tell Qt.py to try only PySide2.

Also, if you need to stick with PySide and can't upgrade to PySide2 yet then you can still download a Qt4 build of Houdini from the main download page.

Cheers,
Rob
User Avatar
Member
2 posts
Joined: Oct. 2009
Offline
Thanks for the quick reply.

If I set the QT_PREFERRED_BINDING=PySide2 environment variable, importing Qt.py no longer crashes Houdini, it just complains that it can't find any Qt bindings.

That said, it's not a big problem. I was just trying to see if I can find a clever solution that would work across Houdini, Maya 2106/17 and Nuke. There is not that much overlap in our code between the programs, so maintaining one version for each of PySide and PySide2 where needed isn't really a problem.
User Avatar
Member
30 posts
Joined:
Offline
Hi Ragnar,

I'm currently down a similar rabbit hole, upgrading our pipe tools to cope with pyside2. I've also been using qt.py as a shim to load pyside.

the problem that i've narrowed down with h16 is that it's QtHelp module will not load.

>>> from PySide2 import QtHelp
Traceback (most recent call last):
  File "<console>", line 1, in <module>
ImportError: DLL load failed: The specified module could not be found.
>>>

This is one of the modules that qt.py tries to load during pyside2 boot and errors out. that's why it can't find the binding.

i've logged a bug with sidefx ( Bug (ID# 80774)). you can harass them to get it fixed faster, hopefully

in the meantime, you can edit out any references to QtHelp in qt.py to get it working.

cheers,
chrisg
Edited by doctorbob - March 2, 2017 17:21:49
User Avatar
Staff
1255 posts
Joined: July 2005
Offline
doctorbob
i've logged a bug with sidefx ( Bug (ID# 80774)). you can harass them to get it fixed faster, hopefully

Ah, good reminder. I looked into that bug a bit and had a proposed solution. Let me circle back on that.

Don't harass, only love!

Cheers,
Rob
User Avatar
Member
30 posts
Joined:
Offline
thanks rob. much love.

cheers,
chrisg
  • Quick Links