import hou

   6431   4   1
User Avatar
Member
230 posts
Joined: Oct. 2009
Offline
I would like to access my scene using python instead of hbatch. In the masterclass_python tutorial from Siggraph 2008, it just runs python and then import hou.

I have installed H12 in Linux ubuntu11, and I run python 2.6 and then trying to import hou but I get an error where No module named hou. How can I get import hou working with my python scripts and when I am running python on terminal? I guess some variables missing and I have to create them manually, but I am not sure which file I have edit and what variables missing.
User Avatar
Member
1926 posts
Joined: Nov. 2006
Offline
You need to have a couple things set in your environment. Check this link out. http://www.sidefx.com/docs/houdini12.0/hom/commandline [sidefx.com]
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
230 posts
Joined: Oct. 2009
Offline
graham
You need to have a couple things set in your environment. Check this link out. http://www.sidefx.com/docs/houdini12.0/hom/commandline [sidefx.com]

thanks again graham, I did that:
PYTHONPATH=$HFS/houdini/python2.6libs
export PYTHONPATH

in the .bashrc but when I am importing hou I get this error:
Traceback (most recent call last):
File “<stdin>”, line 1, in <module>
File “/opt/hfs12.0.543.9/houdini/python2.6libs/hou.py”, line 18, in <module>
import _hou
ImportError: libpython2.6.so.1.0: cannot open shared object file: No such file or directory

but again when I am running sys.path the python2.6libs is there.
User Avatar
Member
230 posts
Joined: Oct. 2009
Offline
I guess the easiest way is to launch hython from terminal and everything is set. But still, I would be nice to understand why I get this error.
User Avatar
Member
16 posts
Joined: July 2020
Offline
Hi, if anyone else stumbles upon this thread while trying to use the hou module (e.g. for headless processing) and running the script here https://www.sidefx.com/docs/houdini/hom/commandline.html [www.sidefx.com]

Try using the version of Python that's shipped with Houdini, for me on Windows it's '/c/Program Files/Side Effects Software/Houdini 19.5.303/python39/python3.9.exe'

Run the python script using this executable.
  • Quick Links