art3mis Posted October 6, 2018 Share Posted October 6, 2018 (edited) 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 October 6, 2018 by art3mis Quote Link to comment Share on other sites More sharing options...
blackhof Posted October 6, 2018 Share Posted October 6, 2018 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 1 Quote Link to comment Share on other sites More sharing options...
art3mis Posted October 6, 2018 Author Share Posted October 6, 2018 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) Quote Link to comment Share on other sites More sharing options...
blackhof Posted October 6, 2018 Share Posted October 6, 2018 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. Quote Link to comment Share on other sites More sharing options...
art3mis Posted October 6, 2018 Author Share Posted October 6, 2018 Thanks. >>> import sys >>> sys.path.append("/home/jim/yt-conda/bin") And then type >>>import yt Still get an error:( ImportError: No module named yt even though yt IS in my bin folder. Something strange is happening. Quote Link to comment Share on other sites More sharing options...
animknight Posted October 7, 2018 Share Posted October 7, 2018 (edited) 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 October 7, 2018 by animknight Quote Link to comment Share on other sites More sharing options...
art3mis Posted October 7, 2018 Author Share Posted October 7, 2018 (edited) 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 October 7, 2018 by art3mis Quote Link to comment Share on other sites More sharing options...
art3mis Posted November 1, 2018 Author Share Posted November 1, 2018 Tried installing using pip but get repeated "Requirement already satisfied:" Question> Is it necessary to launch Houdini from the command line for it to recognize the yt python package? 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.