Skip to content

Instantly share code, notes, and snippets.

@danielsuo
Created December 18, 2020 18:52
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save danielsuo/bc6de77bccc66902b197bece64ef2f7a to your computer and use it in GitHub Desktop.
Save danielsuo/bc6de77bccc66902b197bece64ef2f7a to your computer and use it in GitHub Desktop.
Install mujoco, mujoco py, derivs on macOS
#!/usr/bin/env bash
# Assume:
# - mjkey.txt is in directory $MJKEYDIR
# - We have homebrew, xcode command-line toolsd
# Install MuJoCo
mkdir -p $HOME/.mujoco
wget https://www.roboti.us/download/mujoco200_macos.zip
unzip mujoco200_macos.zip -d $HOME/.mujoco
mv $HOME/.mujoco/mujoco200_macos $HOME/.mujoco/mujoco200
cp $MJKEYDIR/mjkey.txt ~/.mujoco
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/.mujoco/mujoco200/bin
# Install mujoco-py
brew update
# NOTE: these dependencies may be incomplete
brew install gcc
sudo apt-get update
sudo apt-get install -y patchelf python3 python3-dev build-essential libssl-dev libffi-dev libxml2-dev libxslt1-dev zlib1g-dev libglew1.5 libglew-dev python3-pip libgl1-mesa-dev libgl1-mesa-glx libosmesa6-dev python3-numpy python3-scipy python3-dbg gdb
pip install mujoco-py gym
# Test in python
# import gym
# env = gym.make('FetchPush-v1')
# env.reset()
# for _ in range(1000):
# env.step(env.action_space.sample()) # take a random action
# Install mujoco_py_deriv
git clone https://github.com/wecacuee/mujoco_py_deriv
pushd mujoco_py_deriv
pip install -e .
popd
# Test
python tests/test_mujoco_py_deriv.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment