1

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.

J. Siek
  • 43
  • 2
  • 10

4 Answers4

2

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

Ray Walker
  • 285
  • 3
  • 5
0

You can try to reinstall Pycharm for the newest version.

0

After you save the .bashrc file your want execute this code.

source ~/.bashrc

Now link is updated.

Ind
  • 377
  • 2
  • 6
  • 16
0

Please check the user which you run the code with. The mismatch user will cause this problem. There is the checklist may help you:

  1. Don’t use ‘sudo’ to run the code;
  2. Don’t use ‘sudo’ or virtual environment (e.g., anaconda) to run Pycharm (If you run the code in Pycharm).
Xiong-Hui Chen
  • 350
  • 3
  • 13