0

The environment variable currently is not working on the mac terminal.

The following code is the environment variable for Linux:

export LD_LIBRARY_PATH=~/.mujoco/mjpro150/bin${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

export MUJOCO_KEY_PATH=~/.mujoco${MUJOCO_KEY_PATH}

I wonder if there is any difference between the linux environment variable and mac terminal environment variable, are those format totally the same or I need to make some change.

I appreciate your help :)

1 Answer 1

1

Environment variables have the same format as Linux on MacOS. Here's just an example from my own .profile which extends my path variable:

export PATH=/opt/local/bin:/opt/local/sbin:$PATH

Your problem likely stems from something else, such as the MUJOCO_KEY_PATH and LD_LIBRARY_PATH variables not being set with default values. Where are you putting the export statements? Are you sure they are being run? What do you get on the command line if you ask for ${MUJOCO_KEY_PATH} or ${LD_LIBRARY_PATH} both before and after the export statement is run?

Sign up to request clarification or add additional context in comments.

4 Comments

Once I type ${LD_LIBRARY_PATH}, it appears /Users/will/.mujoco/mjpro150/bin: is a directory, and when I type the ${MUJOCO_KEY_PATH}, it appears /Users/will/.mujoco: is a directory, cause I already put the two environment variable into the ~/.bash_profile, the weird thing is the program I run can not connect with those environment variable.
Can you post the errors your program is throwing? As far as I can tell your variables are indeed set correctly in your shell.
./simulate: cannot execute binary file
Try looking through this post askubuntu.com/questions/184280/… - this might be the actual problem you are encountering. If not, please post more information such as the source code of the simulate binary if possible, or why you think this is a path issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.