GeordieM Posted January 19, 2015 Share Posted January 19, 2015 Hi all, I know python but am just starting out uncovering how to get things really working. I have a .pyd file which I need to reference in a script but it cannot be moved into any Houdini folders, it has a lot of dependencies to relative paths in it's folder (a whole game engine). I'm running Win 7 so I'm relying on Houdini's Python not the system install. Where/how do I set an include path to external Python libraries in Houdini's Python? Thanks! Geordie Quote Link to comment Share on other sites More sharing options...
edward Posted January 19, 2015 Share Posted January 19, 2015 https://docs.python.org/2/tutorial/modules.html#the-module-search-path Quote Link to comment Share on other sites More sharing options...
GeordieM Posted January 19, 2015 Author Share Posted January 19, 2015 Thanks for the reply edward! What I'm wondering though is how do most people set this up in Houdini. Do people usually set PYTHONPATH in houdini.env or use sys.path.append in a startup script or something else? Thanks! Geordie Quote Link to comment Share on other sites More sharing options...
kgmcnamara Posted January 8, 2018 Share Posted January 8, 2018 It's an old thread but replying here because I don't think the documentation is very clear on this so it took me a while to refresh myself on how to do this. There are a few options, such as setting in your pythonrc.py, but I find it easiest to add the following to my 123.py and 456.py files since I already set the JOB variable there: import sys sys.path.append("your_path") 2 Quote Link to comment Share on other sites More sharing options...
larabrian Posted March 4, 2020 Share Posted March 4, 2020 On 1/9/2018 at 12:24 AM, kgmcnamara said: import sys sys.path.append("your_path") The better (and more permanent) way to solve this is to set your PYTHONPATH, which provides the interpreter with additional directories look in for python packages/modules. 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.