Skip to content

Instantly share code, notes, and snippets.

@dmklee
Created December 13, 2021 22:11
Show Gist options
  • Save dmklee/9c4566863f708ba3b9e6379fecf758c4 to your computer and use it in GitHub Desktop.
Save dmklee/9c4566863f708ba3b9e6379fecf758c4 to your computer and use it in GitHub Desktop.
Installing mujoco_py on Discovery

[HINT]: use a compute node for this otherwise you'll be waiting a while

  1. Follow instructions to get mujoco binaries
  2. Load anaconda module
module load anaconda3/3.7
  1. Create anaconda environment.
conda create -n <env-name> python=3.7 anaconda
  1. Activate the environment
source activate <env-name>
  1. Download osmesa using anaconda
conda install -c menpo osmesa
  1. Download mujoco-py using pip.
pip install mujoco-py
  1. Compile mujoco_py, which occurs the first time it is imported. It will fail unless you include the path to anaconda's osmesa.
C_INCLUDE_PATH=:$HOME/.conda/envs/<env-name>/include python -c "import mujoco_py"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment