HELP! Setting Environment Variables on MacOS Sonoma

   1860   8   1
User Avatar
Member
54 posts
Joined: June 2021
Online
I'm familiar with UNIX and MacOS but am having a heck of a time setting environment variables in either houdini.env or a json file in the packages directory.

I've tried the simple examples from the doc, e.g.,
{ "env": [ { "MYPATH": ["$HOME/bob_tool", "$HOME/bob/test"] } ] } in a file called, Test.json in the packages directory.

After starting Houdini from the Launcher I execute hconfig -a | grep MYPATH in the Houdini terminal and do not find MYPATH.

I know some of the json files in the packages directory are executed, at least partially. E.g., the ODTools json file in packages adds to the Houdini path, although the other individual env vars are not set.

I would really appreciate advice, any example json files that work, general suggestions for setting env vars on MacOS.

Thanks so much,
Greg
Edited by GregBollella - July 30, 2024 12:21:25
User Avatar
Member
172 posts
Joined: May 2021
Offline
"$MYPATH" ?

For further reference:

PHENOM(enological) DESIGN;
Experimental phenomenology (study of experience) is a category of philosophy evidencing intentional variations of subjective human experiencing where both the independent and dependent variable are phenomenological. Lundh 2020
User Avatar
Member
54 posts
Joined: June 2021
Online
PHENOMDESIGN
"$MYPATH" ?

For further reference:



Thanks. I tried a few things from the video but still no luck.

Seems like this should be pretty simple.

I'm just trying to set an env variable so ODTools Asset Browser can find some thumbnails. Arrggg!!

Greg
User Avatar
Member
172 posts
Joined: May 2021
Offline
Did you restart the Launcher?
Can you share the .json you are trying to use?

I believe you should be placing it in the sidefx_packages outside of and next to the SideFXLabs package .json. (it may be different on windows)

I do not think that it is anymore the case that you are advised to alter the houdini.env

should be like:
https://github.com/Bismuth-Consultancy-BV/MLOPs/blob/main/MLOPs.json [github.com]

Edited by PHENOMDESIGN - July 30, 2024 17:52:41
PHENOM(enological) DESIGN;
Experimental phenomenology (study of experience) is a category of philosophy evidencing intentional variations of subjective human experiencing where both the independent and dependent variable are phenomenological. Lundh 2020
User Avatar
Member
54 posts
Joined: June 2021
Online
PHENOMDESIGN
Did you restart the Launcher?
Can you share the .json you are trying to use?

I believe you should be placing it in the sidefx_packages outside of and next to the SideFXLabs package .json. (it may be different on windows)

I do not think that it is anymore the case that you are advised to alter the houdini.env

Test.json attached. I copied the contents directly from the 20.5 documentation. The path to this Test.json file is:

/Users/bollella/Library/Preferences/houdini/20.5/packages/Test.json

I have restarted Houdini many times but I don't think I tried restarting the Launcher.

I am using the Houdini Terminal and hconfig -a to see if the env var is set and I can never find it using this method. Is there some other method for seeing what env vars are set?

Attachments:
Test.json (101 bytes)

User Avatar
Member
172 posts
Joined: May 2021
Offline
Adjust to where your pip is for Try:

{ "path": "$MYPATH", "enable": true, "env": { "MYPATH": "H://path/cool_tool", "MYPATH_VENV": "$MYPATH/.venv/", "PYTHONPATH": { "value": ["$MYPATH_VENV", "$MYPATH/scripts/test"], "method": "prepend" } } }
Also:

https://github.com/sideeffects/SideFXLabs/blob/Development/README.md [github.com]

"Please note that Houdini-specific environment variables, such as HSITE, HOME, etc., are not automatically recognized in Command Prompt or Houdini Command Line Tools when you type in commands. For command line installation purposes, adding environment variables to houdini.env or a Houdini package definition JSON file is not enough. You have to define them in the system."

export PYTHONPATH=$MYPATH:/path/cool_tool



Make sure to restart the Launcher as well.
Edited by PHENOMDESIGN - July 30, 2024 18:59:59
PHENOM(enological) DESIGN;
Experimental phenomenology (study of experience) is a category of philosophy evidencing intentional variations of subjective human experiencing where both the independent and dependent variable are phenomenological. Lundh 2020
User Avatar
Member
54 posts
Joined: June 2021
Online
Attached the Test.json file with your contents. Restarted the launcher and Houdini, I checked with hconfig -a and I did not see a MYPATH or PYTHONPATH and the file path I added did not show up in the HOUDINI_PATH.

I also attached a file with the output from hconfig -a in the Houdini terminal.

Greg

Attachments:
OutputFromHconfig copy.rtf (18.0 KB)
Test.json (271 bytes)

User Avatar
Member
172 posts
Joined: May 2021
Offline
Sorry about the run 'around. That would be setting up a new environment. If you just need a variable I believe:

You can use this .json attached in the package folder:

Restart Houdini and the Launcher, Open Houdini, Go to Help> About Houdini, then Click Box to "Show Details", make sure path is in your environment variables.

Attachments:
Test.json (120 bytes)
Screenshot 2024-07-30 at 8.09.16PM.png (20.2 KB)
Screenshot 2024-07-30 at 8.08.47PM.png (189.2 KB)

PHENOM(enological) DESIGN;
Experimental phenomenology (study of experience) is a category of philosophy evidencing intentional variations of subjective human experiencing where both the independent and dependent variable are phenomenological. Lundh 2020
User Avatar
Member
54 posts
Joined: June 2021
Online
Great. That worked. I believe I was setting the env var correctly all this time but because I didn't see it when using hconfig I thought it not being set was the problem. Clearly, the problem is somewhere else.

Thanks for sticking through this with me!

Greg
  • Quick Links