Glam Prestige Journal

Bright entertainment trends with youth appeal.

I have a conda environment named tensorflow_p36. When I run import mujoco-py I get the following error:

Exception: Missing path to your environment variable.

Please add following line to .bashrc: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/ubuntu/.mujoco/mujoco200/bin

Therefore, I add the line above to .bashrc:

(tensorflow_p36) ubuntu@ip-172-XX-XX-XXX:~$ echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/ubuntu/.mujoco/mujoco200/bin' >> ~/.bashrc

and

(tensorflow_p36) ubuntu@ip-172-XX-XX-XXX:~$ source ~/.bashrc

This however does not add the environment variable to the conda environmnet. Such that when I run

ubuntu@ip-172-XX-XX-XXX:~$ echo $LD_LIBRARY_PATH

I get:

:/home/ubuntu/.mujoco/mujoco200/bin

but when I run from inside the virtual env

(tensorflow_p36) ubuntu@ip-172-XX-XX-XXX:~$ echo $LD_LIBRARY_PATH

I don't get the exported path showing. Any suggestions on how I can fix this?


What I've tried

I followed this answer:

cd $CONDA_PREFIX
mkdir -p ./etc/conda/activate.d
mkdir -p ./etc/conda/deactivate.d
touch ./etc/conda/activate.d/env_vars.sh
touch ./etc/conda/deactivate.d/env_vars.sh

I edited the env_vars.sh to include

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/ubuntu/.mujoco/mujoco200/bin

Now when I run echo $LD_LIBRARY_PATH from inside the virtual env

(tensorflow_p36) ubuntu@ip-172-XX-XX-XXX:~$ echo $LD_LIBRARY_PATH

I get /home/ubuntu/.mujoco/mujoco200/bin:/home/ubuntu/.mujoco/mujoco200/bin

but the exception remains:

Exception: Missing path to your environment variable. Current values LD_LIBRARY_PATH= Please add following line to .bashrc: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/ubuntu/.mujoco/mujoco200/bin

1 Answer

I had the same issue but solved it by launching the IDE (PyCharm community in my case) from terminal via pycharm-communinity. I found this solutions in this GitHub Issue comment.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy