# Installation
## Requirements
- Mac OS X or Linux machine
- Python >= 3.6 (recommended 3.8.0)
- [conda](https://www.anaconda.com/products/individual)
- [virtualenv](https://virtualenv.pypa.io/en/latest/) is also an acceptable alternative, but we assume you have conda installed in our examples below
## Install robomimic
1. Create and activate conda environment
```sh
$ conda create -n robomimic_venv python=3.8.0
$ conda activate robomimic_venv
```
2. Install PyTorch
[PyTorch](https://pytorch.org/) reference
Option 1: Mac
```sh
# Can change pytorch, torchvision versions
# We don't install cudatoolkit since Mac does not have NVIDIA GPU
$ conda install pytorch==2.0.0 torchvision==0.15.1 -c pytorch
```
Option 2: Linux
```sh
# Can change pytorch, torchvision versions
$ conda install pytorch==2.0.0 torchvision==0.15.1 -c pytorch
```
3. Install robomimic
Option 1: Install from source (recommended)
```sh
$ cd
$ git clone https://github.com/ARISE-Initiative/robomimic.git
$ cd robomimic
$ pip install -e .
```
Option 2: Install via pip
```sh
$ pip install robomimic
```
Warning! Additional dependencies might be required
This is all you need for using the suite of algorithms and utilities packaged with robomimic. However, to use our demonstration datasets, you may need additional dependencies. Please see the [datasets page](../datasets/overview.html) for more information on downloading datasets and reproducing experiments, and see [the simulators section below](installation.html#install-simulators).
# Optional Installations
## Downloading datasets and reproducing experiments
See the [datasets page](../datasets/overview.html) for more information on downloading datasets and reproducing experiments.
## Install simulators
If you would like to run robomimic examples and work with released datasets, please install the following simulators:
robosuite
Required for running most robomimic examples and released datasets. Compatible with robosuite v1.2+. Install via:
```sh
# From source (recommended)
$ cd
$ git clone https://github.com/ARISE-Initiative/robosuite.git
$ cd robosuite
$ pip install -r requirements.txt
OR
# Via pip
$ pip install robosuite
```
**(Optional)** to use our released datasets and reproduce our experiments, switch to our `v1.4.1` branch (requires installing robosuite from source):
```sh
git checkout v1.4.1
```
D4RL
Useful for running some of our algorithms on the [D4RL](https://arxiv.org/abs/2004.07219) datasets.
Install via the instructions [here](https://github.com/rail-berkeley/d4rl).
## Test your installation
This assumes you have installed robomimic from source.
Run a quick debugging (dummy) training loop to make sure robomimic is installed correctly:
```sh
$ cd
$ python examples/train_bc_rnn.py --debug
```
Run a much more thorough test of several algorithms and scripts (**Warning: this script may take several minutes to finish!**):
```sh
$ cd /tests
$ bash test.sh
```
To run some easy examples, see the [Getting Started](./getting_started.html) section.
## Install documentation dependencies
If you plan to contribute to the repository and add new features, you must install the additional requirements required to build the documentation locally:
```sh
$ pip install -r requirements-docs.txt
```
You can test generating the documentation and viewing it locally in a web browser:
```sh
$ cd /docs
$ make clean
$ make apidoc
$ make html
$ cp -r images _build/html/
```
There should be a generated `_build` folder - navigate to `_build/html/` and open `index.html` in a web browser to view the documentation.