jamesr Posted November 6, 2018 Share Posted November 6, 2018 Hi there, Has anyone had any success with importing the hou module from python in a shell on macOS? I am currently running Mojave 10.14.1 with stock python 2.7.10 (fresh OS install) on my laptop, and have not been able to get it up and running. I found a couple of threads related to it from a few years ago suggesting it's not possible, but I sort of figured it would be mentioned in the docs that it's incompatible on macOS. So maybe I'm missing something? Python 2.7.10 (default, Aug 17 2018, 17:41:52) [GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.0.42)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import hou dyld: warning, LC_RPATH $ORIGIN/. in /Applications/Houdini/Houdini17.0.352/Frameworks/Houdini.framework/Versions/Current/Libraries/libopenvdb_sesi.dylib being ignored in restricted program because it is a relative path dyld: warning, LC_RPATH $ORIGIN/. in /Applications/Houdini/Houdini17.0.352/Frameworks/Houdini.framework/Versions/Current/Libraries/libopenvdb_sesi.dylib being ignored in restricted program because it is a relative path dyld: warning, LC_RPATH $ORIGIN/. in /Applications/Houdini/Houdini17.0.352/Frameworks/Houdini.framework/Versions/Current/Libraries/libopenvdb_sesi.dylib being ignored in restricted program because it is a relative path dyld: warning, LC_RPATH $ORIGIN/. in /Applications/Houdini/Houdini17.0.352/Frameworks/Houdini.framework/Versions/Current/Libraries/libopenvdb_sesi.dylib being ignored in restricted program because it is a relative path dyld: warning, LC_RPATH $ORIGIN/. in /Applications/Houdini/Houdini17.0.352/Frameworks/Houdini.framework/Versions/Current/Libraries/libopenvdb_sesi.dylib being ignored in restricted program because it is a relative path dyld: warning, LC_RPATH $ORIGIN in /Applications/Houdini/Houdini17.0.352/Frameworks/Houdini.framework/Versions/Current/Libraries/./libblosc.1.dylib being ignored in restricted program because it is a relative path dyld: warning, LC_RPATH $ORIGIN in /Applications/Houdini/Houdini17.0.352/Frameworks/Houdini.framework/Versions/Current/Libraries/libblosc.dylib being ignored in restricted program because it is a relative path Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Applications/Houdini/Current/Frameworks/Houdini.framework/Versions/Current/Resources/houdini/python2.7libs/hou.py", line 19, in <module> import _hou ImportError: dlopen(/Applications/Houdini/Current/Frameworks/Houdini.framework/Versions/Current/Resources/houdini/python2.7libs/_hou.so, 2): Library not loaded: /Users/prisms/builder-new/WeeklyDevToolsHEAD/dev_tools/local/lib/libz.1.dylib Referenced from: /Applications/Houdini/Houdini17.0.352/Frameworks/Houdini.framework/Versions/Current/Libraries/libAlembic_sidefx.1.7.9.dylib Reason: image not found According to the docs, you need to import DLFCN sys.setdlopenflags(old_dlopen_flags | DLFCN.RTLD_GLOBAL) But there is no DLFCN module for macOS. Python docs suggest generating DLFCN if it's not available, though /usr/include does not exist. I'm not really familiar with these dl related commands. I found this link and tried to just manually replace DLFCN.RTLD_GLOBAL to -1, which got rid of a lot of errors except Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Applications/Houdini/Current/Frameworks/Houdini.framework/Versions/Current/Resources/houdini/python2.7libs/hou.py", line 19, in <module> import _hou ImportError: image not already loaded I also tried the otool steps here which did not seem to change anything. Not really sure where to go from here. Thanks!! Quote Link to comment Share on other sites More sharing options...
Stalkerx777 Posted November 9, 2018 Share Posted November 9, 2018 Don't complicate life, just use the Hython interpreter unless you absolutely must stick to system's Python. Quote Link to comment Share on other sites More sharing options...
jamesr Posted November 9, 2018 Author Share Posted November 9, 2018 (edited) The problem is that I'd like to run HOM functions in a standalone python application among some other more generic python code. Edited November 9, 2018 by jamesr Quote Link to comment Share on other sites More sharing options...
akelian Posted April 2, 2020 Share Posted April 2, 2020 I had the same issue if someone comes find this thread on google, the issue is still there and you have a simple way to solve it: https://www.sidefx.com/forum/topic/72778/ 1 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.