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:
- [Solved] Error in OpenSSL when compiling code locally for raspberry pie
- [Solved] ImportError:lib***.so–cannot open shared object file: No such…(pycharm/clion Error but shell No Error)
- VMware: vmw_ ioctl_ Command error invalid parameter [How to Solve]
- [Solved] ubuntu Run jupyter Error: print(‘Error in generated code:‘, file=sys.stderr) SyntaxError: invalid syntax
- MAC Adb Shell Error: -bash: adb: command not found, adb
- [Solved] Ubuntu pip Install Error: which is not on PATH
- -bash: sqlplus: command not found [How to Solve]
- Termux setting path environment variable
- [Solved] Jetson Nano catkin_make Error: internal compiler error
- Error: loading shared libraries: cannot open shared object file: No such file or directory
- Ubuntu20.04 install the ROS noetic version in catkin_Problems in make compilation
- [Solved] ××: error while loading shared libraries: ××.so.19: cannot open shared object file: No such file or directory
- [Solved] UnicodeEncodeError: ‘ascii‘ codec can‘t encode characters in position 3-9: ordinal not in range(128)
- [Solved] Ubuntu Execute uci Error: uci: error while loading shared libraries: lib
- [Solved] gcc: error trying to exec ‘cc1‘: execvp: No such file or directory
- [Solved] NameError: name ‘reload’ is not defined on ROS melody terminal
- [Solved] Error: no “print“ mailcap rules found for type “text/plain“
- error while loading shared libraries [How to Solve]
- [Solved] Gitlab Error: gitlab-ctl reconfigure Error: STDERR: initdb: error: invalid locale settings; check LANG and L
- How to Use Annotations in Flutter & Dart