Jump to content

Using custom Python modules


art3mis

Recommended Posts

Hi

Is anyone aware of any good beginners tutorials on using custom Python modules with Houdini?

Have been trying now for days to get ytini http://www.ytini.com/getstarted.html

working in Ubuntu, but whatever I try always end up getting

'module not found'

 when I do an

>import yt

in the Python shell.

Edited by art3mis
Link to comment
Share on other sites

I had same problem when I was trying to load  module .Then i got help from Doc.

This is from Doc:

In general, Houdini looks for "scripts" (usually callback scripts) on disk under HOUDINIPATH/scripts/, while modules you would import are under HOUDINIPATH/python2.7libs/. Unfortunately, this is not consistent, so for example Houdini looks for the pythonrc.py initialization script in python2.7libs.

for more : http://www.sidefx.com/docs/houdini/hom/locations.html

  • Like 1
Link to comment
Share on other sites

24 minutes ago, art3mis said:

Thanks!

Couple other noob questions

In the Python Shell what is the difference between


os.environ['PATH']

and


sys.path ?

And if you type


os.environ['PYTHONPATH']

What should it return? (assuming you haven't altered PYTHONPATH)

os.environ['PATH'] : refers to the PATH environment variable, which is a list of directories the operating system tries to find an executable in if you try to start an application without an absolute or relative path like  you can set PATH environment variable to houdini bin directory , then you just type mplay in cmd to run mplay.

os.environ['PYTHONPATH'] : https://docs.python.org/2/using/cmdline.html#envvar-PYTHONPATH

sys.path: are the directories Python searches for modules in when you try to import one

I hope It will help.

Link to comment
Share on other sites

Sorry I couldn't reply to your other thread. Did you try to install yt using the pip install method ?

I didn't have conda installed so I just tried to install using pip real quick and I was able to import yt fine in Houdini. Could you give that a try and see if it works ?

 

-J

 

Edited by animknight
Link to comment
Share on other sites

Thanks!  

used the install script.

Are you on Linux?

I am fairly confident ytini is installed correctly.... but Houdini doesn’t seem to recognize the path I have set... trying to troubleshoot in the Houdini Python shell but not a Python guru.

For instance the instructions suggest doing an 

import yt

but isn’t import only for modules?

I've tried every possible permutation if setting PATH and even trying to set PYTHONPATH 

 

Edited by art3mis
Link to comment
Share on other sites

  • 4 weeks later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...