Python paths on osx

   5490   2   1
User Avatar
Member
795 posts
Joined: April 2020
Offline
Hello all,


I am trying to import a custom python module under osx. I followed these instructions from the help:



“A good way of running your Python code is to import it as a module. Houdini will automatically append all the directories in $HOUDINI_PATH named houdini2.5libs to sys.path. So, if the module is in $HOME/houdiniX.Y/python2.5libs/yourmodule.py, you can run import yourmodule. If the path to the file is not already in sys.path, you’ll need to add it there manually or set $PYTHONPATH before you import it.”


and created “~/Library/Preferences/houdini/11.0/houdini2.6libs” (I also tried 2.5, but I think that 11 loads 2.6 by default.

After doing this my python path in a houdini python shell is as follows:

/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python26.zip
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-darwin
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac/lib-scriptpackages
/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-old
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload
/Library/Python/2.6/site-packages
/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyObjC
/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/wx-2.8-mac-unicode
/Library/Frameworks/Houdini.framework/Versions/11.0.446.9/Resources/houdini/python2.6libs
/Library/Frameworks/Houdini.framework/Versions/11.0.446.9/Resources/python/lib/python2.6/site-packages

Is there something else I need to do to be able to import modules without explicitly adding the path the the python_path?

Any help is appreciated,

Cheers,
Koen
User Avatar
Member
1926 posts
Joined: Nov. 2006
Online
It looks like there's a misprint with the docs. In one instance it seems to be referred to as houdini2.5libs, then the next sentence it is python2.5 libs. It should be python2.#libs, not houdini2.# libs. Just like in $HH. In most instances on the page it is referred to correctly except this one instance. If you name it python2.#libs you should have no problems.
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
795 posts
Joined: April 2020
Offline
Thanks Graham!

Dont know why I picked the one example that does not work ;-)

Koen
  • Quick Links