'HFS' environment variable not set?

   11511   22   2
User Avatar
Member
1 posts
Joined: April 2017
Offline
Hi,

I went through all posts of this thread for the past two days, and I learned a lot!
So thank you to everybody

I first had an issue with importing hou module, but it was fixed thanks to those steps:

- Set $HFS to Houdini's installation folder
- Set $PATH to $HFS\bin
- Append $HFS\houdini\python%d.%dlibs to sys.path

All of that is already well explained in the documentation, but I still had weird issue with it: it couldn't load the DLL.

The main issue was found thanks to this:
rvinluan
I think the problem might be the Python interpreter itself. It looks like it is built with an older compiler version so it probably cannot import the compiled _hou module or its library dependencies because they are built with MSVC 2015.

The reason being that I was excuting my Python script with Python 3.9.5.
BUT I had Houdini with Python 2.7 installed. So I installed Houdini with Python 3 instead.
After some tests, and thanks to rvinluan's post previously mentionned, I understood I also needed to match my Python version to the one shipped with Houdini.
This version is actually Python 3.7.4.
So I downgraded my Python from 3.9.5 to 3.7.4 and everything works fine now!

So huge thanks to everyone on this post who helped me a lot understanding how all of this works together
User Avatar
Member
85 posts
Joined: April 2017
Offline
lucast
Hi,

I went through all posts of this thread for the past two days, and I learned a lot!
So thank you to everybody

I first had an issue with importing hou module, but it was fixed thanks to those steps:

- Set $HFS to Houdini's installation folder
- Set $PATH to $HFS\bin
- Append $HFS\houdini\python%d.%dlibs to sys.path

All of that is already well explained in the documentation, but I still had weird issue with it: it couldn't load the DLL.

The main issue was found thanks to this:
rvinluan
I think the problem might be the Python interpreter itself. It looks like it is built with an older compiler version so it probably cannot import the compiled _hou module or its library dependencies because they are built with MSVC 2015.

The reason being that I was excuting my Python script with Python 3.9.5.
BUT I had Houdini with Python 2.7 installed. So I installed Houdini with Python 3 instead.
After some tests, and thanks to rvinluan's post previously mentionned, I understood I also needed to match my Python version to the one shipped with Houdini.
This version is actually Python 3.7.4.
So I downgraded my Python from 3.9.5 to 3.7.4 and everything works fine now!

So huge thanks to everyone on this post who helped me a lot understanding how all of this works together

Where do you set them? in Environment Variables?

My py23convert.bat is not working and it gives me this error: "The system cannot find the path specified."
I think because of %HFS% inside it.
User Avatar
Staff
1255 posts
Joined: July 2005
Offline
jomaro
Where do you set them? in Environment Variables?

My py23convert.bat is not working and it gives me this error: "The system cannot find the path specified."
I think because of %HFS% inside it.

You can set environment variables within the the command prompt terminal using the Windows `set` command.

However, if you want the basic Houdini environment variables set in your terminal, then it's better to just launch the Houdini Command-Line Tools terminal instead, either by typing "Houdini Command-Line Tools" in the Windows Start menu or by double-clicking on C:/Program Files/Side Effects Software/Houdini X.Y.ZZZ/bin/hcmd.exein the Windows File Explorer.

The Houdini Command-Line Tools terminal is the same as the Windows command prompt terminal but with the Houdini environment source'd so variables like %HFS% are already set for you.

Cheers,
Rob
  • Quick Links