Reputation: 43
I am trying to get mujoco_py running. When I do
import mujoco_py
I get this error:
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/jonah/.mujoco/mjpro150/bin
I have added the above line to both /etc/skel/.bashrc and ~/.bashrc. If I run
echo $LD_LIBRARY_PATH
I get
/home/jonah/.mujoco/mjpro150/bin/
My .mujoco folder includes mjkey.txt and the mjpro150 folder. I can run ./simulate successfully, so I have a feeling that this is some kind of mujoco_py specific bug.
Upvotes: 1
Views: 4953
Reputation: 400
Please check the user which you run the code with. The mismatch user will cause this problem. There is the checklist may help you:
Upvotes: 0
Reputation: 397
After you save the .bashrc file your want execute this code.
source ~/.bashrc
Now link is updated.
Upvotes: 0
Reputation: 293
Which program do you use to import mujoco?
I had a similar issue using mujoco_py with PyCharm Community 2018.1. A workaround was to launch PyCharm from the terminal instead of using the launcher icon. Maybe it could help with your issue too.
Otherwise you could try adding the LD_LIBRARY_PATH to ~/.profile
instead of ~/.bashrc
, as proposed in this answer here: https://askubuntu.com/questions/1022836/python-not-recognizing-ld-library-path/1022913#1022913
Upvotes: 2