Command-Line Python Scripting from Windows

   2288   2   2
User Avatar
113 posts
Joined: July 2005

I am trying to execute a python script from a Windows10 command prompt. I don't know if this is a problem or not but I have Python Visual Studio installed on my machine.
I am running Houdini16.5.323 on an AMD64 driven laptop running Windows 10.

I am following the instructions given from []
I appended “C:\Program Files\Side Effects Software\Houdini 16.5.323\bin\” to my Path variable
I created an HFS variable; C:\Program Files\Side Effects Software\Houdini 16.5.323\
I created a PYTHONPATH variable; C:\Program Files\Side Effects Software\Houdini 16.5.323\houdini\python2.7libs

When I try to run my script; C:\Python27\python.exe
I get the following error:
Traceback (most recent call last):
File “”, line 30, in <module>
File “”, line 25, in enableHouModule
import hou
File “C:\Program Files\Side Effects Software\Houdini 16.5.323\houdini\python2.7libs\”, line 19, in <module>
import _hou
ImportError: DLL load failed: The specified procedure could not be found.

Anyone have any ideas where I might be getting this DLL Load error?
I was able to get it working from my cygwin but not from windows command prompt.

This is the script:
def enableHouModule():
    import sys, os
    if hasattr(sys, "setdlopenflags"):
        old_dlopen_flags = sys.getdlopenflags()
        import DLFCN
        sys.setdlopenflags(old_dlopen_flags | DLFCN.RTLD_GLOBAL)

        import hou
    except ImportError:
        HFS = "C:\Program Files\Side Effects Software\Houdini 16.5.323"
        pythonVersion = "python2.7"
        libs = HFS + "\houdini\\" + pythonVersion + "libs"
        import hou
        if hasattr(sys, "setdlopenflags"):

import hou
User Avatar
183 posts
Joined: Dec. 2011
I'm having this exact issue as well. I think the conflict is coming from my system's python. Perhaps there is a way to swap to using houdini's included python when the hou module is imported?
User Avatar
188 posts
Joined: March 2011

Any luck importing hou without dll errors?

I could do it in some machines, but in my brand new Dell AIO I can´t find a way getting python to import hou without errors.

/python2.7libs was added to pythonpath var.

/bin was added to the path var.
  • Quick Links