When I install Mujoco on Ubuntu 18.04 LTS (Bionic Beaver):
There is no error in the terminal test, but the following error is reported when pycharm runs the test program:
Please add the following line to .bashrc
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/shubhom/.mujoco/mjpro150/bin
However, my .bashrc file has the path already added;
Solution:
- This problem occurs when you run it on terminal.
You should check your ~/.bashrc
add
export LD_LIBRARY_PATH= /path/to/.mujoco/mjpro150/bin {LD_LIBRARY_PATH}}
export MUJOCO_KEY_PATH= /path/to/.mujoco${MUJOCO_KEY_PATH}
and “source ~/.bashrc”
- The problem occurs when you run it on PyCharm.
You should first check if it can run successfully on the terminal.
If it’s ok on the terminal then:
Click Run -> Edit Configuration -> Environment Variables
Add to
LD_LIBRARY_PATH /path/to/.mujoco/mjpro150/bin
MUJOCO_KEY_PATH /path/to/.mujoco
Attach the test code:
import mujoco_py import os mj_path, _ = mujoco_py.utils.discover_mujoco() xml_path = os.path.join(mj_path, 'model', 'humanoid.xml') model = mujoco_py.load_model_from_path(xml_path) sim = mujoco_py.MjSim(model) print(sim.data.qpos) #[0. 0. 1.4 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. # 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. ] sim.step() print(sim.data.qpos) #[-1.12164337e-05 7.29847036e-22 1.39975300e+00 9.99999999e-01 # 1.80085466e-21 4.45933954e-05 -2.70143345e-20 1.30126513e-19 # -4.63561234e-05 -1.88020744e-20 -2.24492958e-06 4.79357124e-05 # -6.38208396e-04 -1.61130312e-03 -1.37554006e-03 5.54173825e-05 # -2.24492958e-06 4.79357124e-05 -6.38208396e-04 -1.61130312e-03 # -1.37554006e-03 -5.54173825e-05 -5.73572648e-05 7.63833991e-05 # -2.12765194e-05 5.73572648e-05 -7.63833991e-05 -2.12765194e-05]
Read More:
- How to Solve labelme Install Error in Ubuntu
- How to Solve Xmind Install Error in Ubuntu System
- mysqlclient in Ubuntu: How to Solve mysqlclient Install Error
- Ubuntu Server: How to Install Chrome
- How to Solve Roscore Run error [Install ROS]
- Ubuntu20.04 install the ROS noetic version in catkin_Problems in make compilation
- [Solved] ubuntu Run jupyter Error: print(‘Error in generated code:‘, file=sys.stderr) SyntaxError: invalid syntax
- CentOS: How to Solve Python File Run Error
- How to Solve Ubuntu “Failed to fetch” Error
- Linux: How to Solve Rabbitmq Plug-in Install Error
- How to Solve Ubuntu20.04 Compile Error:error while loading shared libraries: libncurses.so.5
- [Solved] Ubuntu pip Install Error: which is not on PATH
- Ubuntu Run Error: not syncing : VFS: Unable to mount root
- [Solved] Ubuntu Compile Rust Program Error: failed to run custom build command for openssl-sys v0.9.39
- EasyConnect linux (ubuntu 20.04) Run Error [How to Solve]
- [Solved] Any Softwares Install Error in Ubuntu: /usr/bin/dpkg returned an error code
- How to Uncompress 7z files on Ubuntu, Debian, Fedora
- [Solved] Ubuntu 20.04 install MATLAB and toolbox permissions Error
- How to Solve Error: Address already in use
- [Solved] ImportError:lib***.so–cannot open shared object file: No such…(pycharm/clion Error but shell No Error)