Installation

August 27, 2021 ยท View on GitHub

(Tested on Ubuntu 20.04)

Overview

  1. Clone the repo.
  2. Set up a Conda env.
  3. Install python modules (including bundled dependencies).

Clone repo with git submodules

git clone --recursive https://github.com/indylab/nxdo
cd nxdo

If you've already cloned this repo but not the submodules, you can clone them with:

git submodule update --init --recursive

Set up Conda environment

After installing Anaconda, enter the repo directory and create the new environment:

conda env create -f environment.yml
conda activate grl

Install Python modules

1. DeepMind OpenSpiel (included dependency)

DeepMind's OpenSpiel is used for poker game logic as well as tabular game utilities. We include a slightly modified fork as a dependency.

With the new conda env active:

# Starting from the repo root
cd dependencies/open_spiel
./install.sh # git clones and apt installs additional dependencies
pip install -e . # This will start a compilation process. May take a few minutes.
cd ../..

2. The GRL Package (main package).

# Starting from the repo root
pip install -e .

Installation is now done!

Advanced Installation Notes (Optional)

If you need to compile/recompile OpenSpiel without pip installing it, perform the following steps with your conda env active. (The conda env needs to be active so that OpenSpiel can find and compile against the python development headers in the env. Python version related issues may occur otherwise):

mkdir build
cd build
CC=clang CXX=clang++ cmake -DPython_TARGET_VERSION=3.6 -DCMAKE_CXX_COMPILER=${CXX} -DPython3_FIND_VIRTUALENV=FIRST -DPython3_FIND_STRATEGY=LOCATION ../open_spiel
make -j$(nproc)
cd ../../..

To import OpenSpiel without using pip, add OpenSpiel directories to your PYTHONPATH in your ~/.bashrc (more details here):

# Add the following lines to your ~/.bashrc:
# For the python modules in open_spiel.
export PYTHONPATH=$PYTHONPATH:/<path_to_open_spiel_submodule>
# For the Python bindings of Pyspiel
export PYTHONPATH=$PYTHONPATH:/<path_to_open_spiel_submodule>/build/python

Next Steps

See Running Experiments