HOM from shell in macOS

   1694   2   2
User Avatar
Member
15 posts
Joined: Feb. 2016
Offline
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 [www.sidefx.com], 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 [www.sidefx.com], you need to
import DLFCN
    sys.setdlopenflags(old_dlopen_flags | DLFCN.RTLD_GLOBAL)

But there is no DLFCN module for macOS.
Python docs [docs.python.org] 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 [bugs.python.org] 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

and also the otool steps here [www.sidefx.com] which did not seem to change anything. Not really sure where to go from here.



Thanks!!
Edited by jamesr - Nov. 5, 2018 14:15:50
User Avatar
Member
171 posts
Joined: Jan. 2019
Offline
Hi,

Sorry for resurrecting such and old post, but did you ever get this to work? As I'm having similar issues.

Thanks,

David
User Avatar
Member
15 posts
Joined: Feb. 2016
Offline
Hi David, nope! I think I abandoned that. If you can, it's probably easier to source the houdini environment and use hython.

cd /Applications/Houdini/Current/Frameworks/Houdini.framework/Versions/Current/Resources
source houdini_setup
hython
  • Quick Links