Installing OpenAI Gym and Universe

Now let's see how to install OpenAI Gym and Universe. Before that, we need to install several dependencies. First, let's activate the conda environment we just created using the following command:

source activate universe

Then we will install the following dependencies:

sudo apt-get update
sudo apt-get install golang libcupti-dev libjpeg-turbo8-dev make tmux htop chromium-browser git cmake zlib1g-dev libjpeg-dev xvfb libav-tools xorg-dev python-opengl libboost-all-dev libsdl2-dev swig

conda install pip six libgcc swig
conda install opencv

Throughout this book, we will be using gym version 0.7.0 so you can install gym directly using pip as:

pip install gym==0.7.0

Or you can clone the gym repository and install the latest version by following command:

cd ~
git clone https://github.com/openai/gym.git
cd gym
pip install -e '.[all]'

The preceding commands will fetch the gym repository and install gym as a package, as shown in the following screenshot: