Installation

Install Garage in a Python Environment

Garage is a Python package which can be installed in most Python 3.6+ environments using standard commands, i.e.

pip install --user garage

We recommend you build your project using a Python environment manager which supports dependency resolution, such as pipenv, conda, or poetry. We test against pipenv and conda.

Garage is also tested using virtualenv. However, virtualenv has difficulty resolving dependency conflicts which may arise between garage and other packages in your project, so additional care is needed when using it. You are of course free to install garage as a system-wide Python package using pip, but we don’t recommend doing so.

NOTE: garage only supports Python 3.6+, so make sure you Python environment is using this or a later version. You can still install version 2020.06 if you need to use Python 3.5.

  • pipenv

pipenv --three  # garage only supports Python 3.6+
pipenv install --pre garage  # --pre required because garage has some dependencies with verion numbers <1.0
  • conda (environment named “myenv”)

conda activate myenv
pip install garage

Alternatively, you can add garage in the pip section of your environment.yml

name: myenv
channels:
  - conda-forge
dependencies:
- python>=3.6
- pip
- pip
  - garage
  • virtualenv (environment named “myenv”)

source myenv/bin/activate
pip install garage

Install Environment Dependencies (Optional)

Generally speaking, system dependencies of garage are minimal, and likely already installed. However, many of the environments garage is used with have additional dependencies, and we provide “setup scripts” for installing those dependencies and working around known problems on common platforms.

If you can already use the environments you need, you can skip this section.

A MuJoCo key is required to run these install scripts. You can get one here: https://www.roboti.us/license.html

In order to use those scripts, please do the following:

Clone our repository (https://github.com/rlworkgroup/garage) and navigate to its directory.

Then, from the root directory of the repo, run the script.

  • On Linux:

./scripts/setup_linux.sh --mjkey path-to-your-mjkey.txt
  • On macOS:

./scripts/setup_macos.sh --mjkey path-to-your-mjkey.txt

Please note that the setup script for macOS relies on homebrew to install dependencies. If you don’t already have homebrew, the script will attempt to install it. If you do have homebrew, make sure that your user has permission to install things with it. Sometimes npm and brew compete for control over folders, and it’s easy to mess up folder permissions when trying to resolve those conflicts. If you run into these issues, a clean install of homebrew usually solves them.

If all of the system dependencies were installed correctly, then the exact version of common RL environments that work with garage can be installed via pip:

pip install 'garage[mujoco,dm_control]'

Extra Steps for Garage Developers

See here


This page was authored by K.R. Zentner (@krzentner), with contributions from Gitanshu Sardana (@gitanshu), Hayden Shively (@haydenshively), Ryan Julian (@ryanjulian), Jonathon Shen (@jonashen), Keren Zhu (@naeioi), Peter Lillian (@pelillian), Gautam Salhotra (@gautams3), Aman Soni (@amansoni), and Rocky Duan (@dementrock).