[Sidefx-houdini-list] Python scripts and HOUDINI_PATH

Graham Thompson captainhammy at gmail.com
Tue Jul 10 18:45:50 EDT 2012


The Python python2.Xlibs folders need to live in the houdini/ folder,
not houdini/scripts, just like in $HFS/houdini/python2.6libs/.  You
can also put Python files in houdini/scripts/python directories and
they will work for 2.5 and 2.6.

With regards to your other problem, you need to "import hou" in your
456.py file.

On Tue, Jul 10, 2012 at 3:22 PM, Rangi Sutton <rangi at kanuka.com.au> wrote:
> Hi folks,
>
> Using H12.0.634 on linux, python 2.7.3.
>
> Trying to get modules to be found using HOUDINI_PATH, and attempting
> to avoid setting HOUDINI_SCRIPT_PATH as well.
>
> From what I have read the modules belong somewhere  in HOUDINI_PATH
> under scripts/python2.6lib
>
> Launching hython from that directory I can find my foo.py module. It
> gives me that hou not defined error, which is weird as it can find hou
> when I subsequently type in interactively. But that's a maybe
> unrelated thing.
>
> rsutton at bne-vfxws07 ~/vfxdev/ce_houdini_1.0/scripts/python2.6lib
> $ hython
> Error running Python code:
> Traceback (most recent call last):
>   File "/home/rsutton/vfxdev/ce_houdini_1.0/scripts/456.py", line 7, in <module>
>     if hou.node('/out/ce_ver_cntl') == None:
> NameError: name 'hou' is not defined
>
> Python 2.6.4 (r264:75706, Feb 18 2010, 17:55:49)
> [GCC 4.4.1] on linux2
> Houdini 12.0.634 hou module imported.
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import foo
>>>> foo.bar()
> 3
>
> -----------------
>
> Now trying same thing not in that directory and relying on env paths,
> no such luck.
>
> rsutton at bne-vfxws07 ~
> $ hython
> Error running Python code:
> Traceback (most recent call last):
>   File "/home/rsutton/vfxdev/ce_houdini_1.0/scripts/456.py", line 7, in <module>
>     if hou.node('/out/ce_ver_cntl') == None:
> NameError: name 'hou' is not defined
>
> Python 2.6.4 (r264:75706, Feb 18 2010, 17:55:49)
> [GCC 4.4.1] on linux2
> Houdini 12.0.634 hou module imported.
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import foo
> Traceback (most recent call last):
>   File "<console>", line 1, in <module>
> ImportError: No module named foo
>
> ---------------------
>
> rsutton at bne-vfxws07 ~
> $ echo $HOUDINI_PATH
> /home/rsutton/houdini;/vfx/test_job/assets/rsutton/houdini;/home/rsutton/vfxdev/ce_houdini_1.0;&
>
> HOUDINI_PATH                              :=
> "/home/rsutton/houdini;/vfx/frank/assets/rsutton/houdini;/home/rsutton/vfxdev/ce_houdini_1.0;&"
>     The path of directories where Houdini looks for configuration
>     files.
>
>     Directories searched (in order) are:
>         1) "/vfx/test_job/assets/rsutton/houdini"
>         2) "$HOME/vfxdev/ce_houdini_1.0"
>         3) "$HOME"
>         4) "$HOME/houdini12.0"
>         5) "$HFS/houdini"
>
>
> -----------------------
>
> foo.py lives:
>
> $HOME/vfxdev/ce_houdini_1.0/scripts/python2.6lib/foo.py
>
> Any ideas what I'm doing wrong? Are people using HOUDINI_SCRIPT_PATH
> mostly? Trying to avoid more vars to manage...
>
> Any thoughts on the hou module not being found by 456.py from hython
> as well? Doesn't seem to have the problem launching GUI.
>
> Cheers,
> Rangi.
> _______________________________________________
> Sidefx-houdini-list mailing list
> Sidefx-houdini-list at sidefx.com
> https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list



More information about the Sidefx-houdini-list mailing list