I'm trying to integrate a variety of ML capabilities into a Houdini project. Since each one of these capabilities requires a sort of jenga tower of dependencies, I'm managing all of this using virtual environments. This is currently working entirely in the OBJ context. I just make sure everything in the venv is created using the same 3.11.7 version as hou python, and it seems to work well enough if I just use a script node to call a .py that activates an environment at the beginning before it runs each time.
It works well enough, but obviously it isn't as great as TOPS can be (I'll be running these inference operations many times on many different objects, so efficiency is key) so I was pretty excited when I saw that there is a TOPS virtual environment node. But when I point it to a virtual environment and point it to another python interpreter and list out some packages for it to import, I get nothing. Every script I run that tries to use any of the libraries listed to import error out because it can't find them. I've also let the tops node create a brand new virtual environment and still nothing.
So, how is this supposed to work?
Am I correct in thinking that once I have this working, basically any python process that is activated by tops nodes after the virtual environment has been activated via a python virtual environment node, they will be running using that virtual environment?
Specifically, let's say that I have a python script in the OBJ context that is running in either a python node or a script node, and that python script needs to import scipy or whatever to run. If I cook that SOP from the tops context after I've initialized a python venv node that says "use this venv, use this python interpreter, import these libraries", will all of those python scripts run using the virtual environment that was declared by the tops venv node?
Or does it only make the venv accessible in the tops context? (I can't get tops python nodes to see the libraries that are imported by the venv python node either)
Is there anything else I need to do for the settings on this thing? I pointed it to a virtual environment, I pointed it to a python interpreter, and I gave it a list of valid packages to install with pip, but I can't get any python node anywhere in houdini to see those package imports.
I'm currently using Houdini 20.5 OSX apple silicon. I haven't messed with it much on my windows workstation yet. Is this something that doesn't work that great on Mac and might work better on windows? (I'll try myself tomorrow, just putting this in there as another thought)
Anyways, thanks.