This package contains:
-
dm_control.mjcf: A library for composing and modifying MuJoCo MJCF models in Python. -
dm_control.mujoco: Libraries that provide Python bindings to the MuJoCo physics engine. -
dm_control.suite: A set of Python Reinforcement Learning environments powered by the MuJoCo physics engine. -
dm_control.viewer: An interactive environment viewer.
If you use this package, please cite our accompanying tech report.
Follow these steps to install dm_control:
-
Download MuJoCo Pro 2.00 from the download page on the MuJoCo website. MuJoCo Pro must be installed before
dm_control, sincedm_control's install script generates Pythonctypesbindings based on MuJoCo's header files. By default,dm_controlassumes that the MuJoCo Zip archive is extracted as~/.mujoco/mujoco200_$PLATFORMwhere$PLATFORMis eitherlinux,win64, ormacos. -
Install the
dm_controlPython package by runningpip install git+git://github.com/deepmind/dm_control.git(PyPI package coming soon) or by cloning the repository and runningpip install /path/to/dm_control/. We recommendpip installing into avirtualenv, or with the--userflag to avoid interfering with system packages. At installation time,dm_controllooks for the MuJoCo headers from Step 1 in~/.mujoco/mujoco200_$PLATFORM/include, however this path can be configured with theheaders-dircommand line argument. -
Install a license key for MuJoCo, required by
dm_controlat runtime. See the MuJoCo license key page for further details. By default,dm_controllooks for the MuJoCo license key file at~/.mujoco/mjkey.txt. -
If the license key (e.g.
mjkey.txt) or the shared library provided by MuJoCo Pro (e.g.libmujoco200.soorlibmujoco200.dylib) are installed at non-default paths, specify their locations using theMJKEY_PATHandMJLIB_PATHenvironment variables respectively.
The MuJoCo Python bindings support three different OpenGL rendering backends:
EGL (headless, hardware-accelerated), GLFW (windowed, hardware-accelerated), and
OSMesa (purely software-based). At least one of these three backends must be
available in order render through dm_control.
-
Hardware rendering with a windowing system is supported via GLFW and GLEW. On Linux these can be installed using your distribution's package manager. For example, on Debian and Ubuntu, this can be done by running
sudo apt-get install libglfw3 libglew2.0. Please note that:dm_control.viewercan only be used with GLFW.- GLFW will not work on headless machines.
-
"Headless" hardware rendering (i.e. without a windowing system such as X11) requires EXT_platform_device support in the EGL driver. Recent Nvidia drivers support this. You will also need GLEW. On Debian and Ubuntu, this can be installed via
sudo apt-get install libglew2.0. -
Software rendering requires GLX and OSMesa. On Debian and Ubuntu these can be installed using
sudo apt-get install libgl1-mesa-glx libosmesa6.
By default, dm_control will attempt to use GLFW first, then EGL, then OSMesa.
You can also specify a particular backend to use by setting the MUJOCO_GL=
environment variable to "glfw", "egl", or "osmesa", respectively.
-
The above instructions using
pipshould work, provided that you use a Python interpreter that is installed by Homebrew (rather than the system-default one). -
Before running, the
DYLD_LIBRARY_PATHenvironment variable needs to be updated with the path to the GLFW library. This can be done by runningexport DYLD_LIBRARY_PATH=$(brew --prefix)/lib:$DYLD_LIBRARY_PATH.
