1

I am trying to get my OpenAI Gym w/ MuJoCo Python files running from a PyCharm configuration but I am getting "missing path to your environment variable" exception related to mujoco_py.

These are the Env Vars I can't seem to add to PyCharm because they have the same name and will 'replace' eachother.

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/nvidia
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/<user>/.mujoco/mujoco210/bin

I can run the Python scripts perfectly from the terminal, as all my env vars are in my .bashrc, but of course I want the console and such working in PyCharm.

So, the error I get when trying to run my script from PyCharm is:

raise Exception("\nMissing path to your environment variable. \n"
Exception: 
Missing path to your environment variable. 
Current values LD_LIBRARY_PATH=/home/<user>/anaconda3/envs/mujoco210_openai_gym/lib/python3.9/site-packages/cv2/../../lib64:
Please add following line to .bashrc:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/<user>/.mujoco/mujoco210/bin

And when I add this Env Var in the "Edit Configuration", it moves onto the next Env Var I'm missing...

Please add following line to .bashrc:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/nvidia

The problem that I run into is that they have the SAME NAME. If I put both of these Env Vars into my configuration, as separate Env Var fields, PyCharm will only read one and throw the same missing Env Var for the other. If I combine them into the same Env Var field, with the same name, and separated by a semi-colon ; I still get the same issue.

How can I add both these Env Vars into PyCharm?

I am running Ubuntu 20.04, PyCharm 2021.2.3 Community Edition, MuJoCo 2.1.0, mujoco_py 1.50.1

Thank you greatly!

jp-ai
  • 11
  • 1

1 Answers1

0

When editing the configuration, it is necessary to separate multiple LD_LIBRARY_PATH environment variables with the same name with a colon. For example,

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/<user>/.mujoco/mujoco210/bin:$LD_LIBRARY_PATH:/usr/lib/nvidia.
Simas Joneliunas
  • 2,890
  • 20
  • 28
  • 35