catchyid Posted October 24, 2019 Share Posted October 24, 2019 Hi, If I try to import "hou" module using the standard python2.7 interpreter, it crashes. If I use the python interpreter that's shipped with Houdini and I import "hou" module, it also complains about jemalloc libs I see that the only way to use "hou" module is either (1) inside houdini directly (e.g. in parameters), OR (2) by running hython --> Is this correct? I just don't see it logical that I have a python module "hou" that can only be used inside hython interpreter? for example, If I were to write a studio wide tool that needs to process houdini object, then in this specific case I must hython, otherwise I can use python? Thanks Quote Link to comment Share on other sites More sharing options...
catchyid Posted October 25, 2019 Author Share Posted October 25, 2019 Hi, Just an update if someone is still reading It seems to me that application specific interpreters, such as hython in Houdini or mayapy for Maya, are just there to run their own python modules...I "think" over simplifying hou as just a standard python module is just wrong, i.e. it must be run by hython interpreter ... Now that seems rather limiting! what if you want to have a python script that processes both houdini and maya objects? It would be still possible, but this won't be in "one" application. Quote Link to comment Share on other sites More sharing options...
Stalkerx777 Posted October 28, 2019 Share Posted October 28, 2019 It is possible(or at least was possible) to use the hou module in a standard system interpreter, there's even a help page somewhere in the docs. Using both Maya and Houdini interpreters within a single app (or package) could be tricky, but definitely possible and depends on your use case. Unless you required to use both APIs at the same time you can organize your code in such a way where Maya mypy instance communicates with a standalone Hython instance through a simple intermediate disk file or an RPC server. 1 Quote Link to comment Share on other sites More sharing options...
catchyid Posted October 28, 2019 Author Share Posted October 28, 2019 Thanks Alex...Logically, it should be possible to use them in standard interpreter as you mentioned, maybe I am doing something wrong (my first time to write python code ) ... Quote Link to comment Share on other sites More sharing options...
StepbyStepVFX Posted October 29, 2019 Share Posted October 29, 2019 Guys, I am not a developper by any means, but from what I understand, and "API" is an Application Programming Interface, which means it requires an instance of your application to be run in any case (Houdini, Maya...). The module you use "HOU" is just a library of functions that Python (or C++ in case of SDK) understands and calls the application (Houdini, Maya...). So it is really just an "interface" between standard programming language and an application. I guess you can run an instance of your application in "command line" (Houdini or Maya with no GUI) and use that / declare it from a standard Python file executed in Python, and from there it should work. But to don't ask my how, never tried with Houdini or Maya. Quote Link to comment Share on other sites More sharing options...
catchyid Posted October 29, 2019 Author Share Posted October 29, 2019 Yes, what you says is correct JO. The problem I am facing is compatibility between binaries, meaning, we have main components: (1) the default python interpreter, (2) python interpreter/libs that ships with Houdini (are they exactly the same like the default implementation, i.e. item 1, or do they have something special, I guess only SideFX people will know) (3) Hou python module Now, a simple question: can I import (3) using (1) OR I "must" use (2) in order to import (3)? In theory, I should be able to use the default interpreter, ie (1), to import Hou but from my testing this is not the case. There are many reasons why for this limitation (for example, binaries complied with different flags, mismatched versions, it's too complicated...). Anyhow, my conclusion is that I must use (2) to import Hou. Now, add this compatibility issue using Maya modules, Maya Python interpreter... Quote Link to comment Share on other sites More sharing options...
catchyid Posted November 1, 2019 Author Share Posted November 1, 2019 just an update : It's possible to import hou in standard python interpreter...the problem I was having is the python interpreter I used was compiled with gcc 5.4 and Houdini was compiled with gcc 6.3 --> so it's a binary (or ABI) incompatibility, hence the crash. To fix there are two solutions: either use the python interpreter shipped with Houdini, or update the python interpreter to match at least the same gcc version used to compile Houdini... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.