Problems with PyQt4

   8197   8   2
User Avatar
Member
1 posts
Joined: April 2011
Offline
Hi,

I have a problem when import the some library of PyQt4 inside houdini this is an example:

>>> from PyQt4 import QtGui
Traceback (most recent call last):
File “<console>”, line 1, in <module>
ImportError: dlopen(/Library/Python/2.6/site-packages/PyQt4/QtGui.so, 2): Library not loaded: QtGui.framework/Versions/4/QtGui
Referenced from: /Library/Python/2.6/site-packages/PyQt4/QtGui.so
Reason: no suitable image found. Did find:
/Library/Frameworks/QtGui.framework/Versions/4/QtGui: GC capability mismatch

I can't undertand what this error mean?

I tried under Python2.6 and works fine so is impossible for me to understand what happening when I run it under houdini.

My system is a MacBook with Mac OS X 10.6.6

I follow this steps to install the PyQt4:

1/ Install the last compiled version of Qt with cocoas

qt-mac-opensource-4.7.2.dmg

2/ Download and install the last version of SIP with this parameters:

python2.6 configure.py -n -d /Library/Python/2.6/site-packages -b /usr/local/bin -e /usr/local/include -v /usr/local/share/sip –arch=x86_64 -s MacOSX10.6.sdk
make
sudo make install

3/ Download and install the last version of PyQt4 with this parameters:

Then, assuming the above SIP configuration, and the Qt installer binaries (configuring the paths like with SIP):

python2.6 configure.py -d /Library/Python/2.6/site-packages -b /usr/local/bin
make
sudo make install

Thanks for help!!
User Avatar
Member
1908 posts
Joined: Nov. 2006
Offline
Unfortunately it's never been possible to do this on OS X. It is also impossible to import the hou module into a normal Python session. The problem is due to differences in applications/modules being compiled with or without OS X's garbage collection. I spent a while trying to get it to work back when I was using my Mac but had no success. As I recall Mike Taylor, the then developer working on Houdini on the Mac who was helping me, also told me it was not possible. It may be possible in the future but as of now you are out of luck.
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
98 posts
Joined: Sept. 2008
Offline
Dear All,

In that case, let me change the subject a little bit I've just seen that there is a version of wxPython compiled for cocoa (Mac OS X 10.6.6, right?), but it requires Python 2.7… do you know how to use Python 2.7 with houdini? I'm not sure whether this is possible at all, as I've tried changing it with

export HOUDINI_PYTHON_VERSION=2.7

but Houdni gave an error… any ideas?

If PyQt4 and wxPython are not an option, then do you know of ANY other possibility to create a simple GUI for a Python embedded application? I mean, something where we can add buttons and checkboxes for confiuring our pure-Python algorithms in Houdini…

thanks!!!

dagush.-
PS Adriariu and I, we are working together…
————————-
* skylineEngine project coordinator
* buildingEngine module developer
http//ggg.udg.edu/skylineEngine
User Avatar
Member
1908 posts
Joined: Nov. 2006
Offline
Houdini 11 does not support Python 2.7. Future versions may support it. However, even if you did have 2.7 available you would run into the same problem as you are now. Houdini, while it uses parts of the system Python on OS X, is not compatible with using custom installed modules and such. No PyQt, wxPython, pygame, etc. It would be great if it did, or would in the future but currently that isn't so. I've tried compiling all the Qt stuff from scratch to try and make it happy but it didn't end well. I'm not an OS X expert though so it may very well be possible to compile things in such a way that they do work but I haven't heard of anyone able to do that.

This is the reason I haven't spent any significant amount of time in years attempting to develop any GUI based tools. Linux it's great and super easy, Windows is doable without that much issue (wx at least) but OS X is the kicker. Perhaps it would be possible to request the open source pyside toolkit (lgpl Qt bindings) be shipped with Houdini if the licensing would allow it.
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
98 posts
Joined: Sept. 2008
Offline
That would be great!!!
However, for our project, we'll have to find a workaround to keep going… We'll see…

best regards and thanks for your help, graham!!!!

dagush.-
————————-
* skylineEngine project coordinator
* buildingEngine module developer
http//ggg.udg.edu/skylineEngine
User Avatar
Member
7743 posts
Joined: July 2005
Offline
I think the question is whether you can just use a regular HDA to define your user interface. That would be the best if you could. Failing that, you could also try using hou.ui.createDialog() but that will only support a limited widget set as well.
User Avatar
Member
98 posts
Joined: Sept. 2008
Offline
Dear Edward,

I think we'll probably resort to creating a regular but empty (dummy) HDA, purely for GUI purposes, and perform a node.setSelected() every time the GUI needs to be displayed. In the dummy HDA we'll probably have a button with something like “run” which will have a callback to our main code with the hda itself as parameter. Not very elegant, but definitely cross platform! -)

With respect to the UI script, I've discovered that hou.ui.createDialog() is NOT in the documentation for hou.ui (http//www.sidefx.com/docs/houdini11.0/hom/hou/ui), so I'm wondering how official or stable it is. Anyway, after a lot of guessing I managed to open a silly script window with

d = hou.ui.createDialog(“path/test.ui”)

where test.ui is the attached file. I'm posting it here just for illustrative purposes, just in case anyone wants to try. I think it's a VERY interesting way to create custom dialogs. Now, I only need to understand the docs at

http//www.sidefx.com/docs/hdk11.0/hdk_uinative_uiscript.html

which are a bit hard to start with. There aren't any other docs, right? ;-)

Anyway, we'll probably stick to the dummy HDA GUI node, which seems like a more lasting solution.

Thanks a lot for all your help!!!

regards

dagush.-

Attachments:
test.ui.zip (800 bytes)

————————-
* skylineEngine project coordinator
* buildingEngine module developer
http//ggg.udg.edu/skylineEngine
User Avatar
Member
1908 posts
Joined: Nov. 2006
Offline
hou.ui.createDialog isn't documented because it was never something really intended to be used except internally for things such as the cloud and pre-flight render dialogs. UI script isn't the best documented or exampled feature either. That's not to say you can't do anything with it of course. I've demoed the feature in a class I've given before.
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
7743 posts
Joined: July 2005
Offline
I think there's discussion about it here:
http://www.sidefx.com/index.php?option=com_content&task=view&id=1810&Itemid=344 [sidefx.com]
  • Quick Links