Clone this repository

git clone

Install the unstable development version of FinRL:

pip install git+


For OpenAI Baselines, you’ll need system packages CMake, OpenMPI and zlib. Those can be installed as follows


sudo apt-get update && sudo apt-get install cmake libopenmpi-dev python3-dev zlib1g-dev libgl1-mesa-glx

Mac OS X

Installation of system packages on Mac requires Homebrew. With Homebrew installed, run the following:

brew install cmake openmpi

Windows 10

To install stable-baselines on Windows, please look at the documentation.

Create and Activate Virtual Environment (Optional but highly recommended)

cd into this repository

cd FinRL-Library

Under folder /FinRL-Library, create a virtual environment

pip install virtualenv

Virtualenvs are essentially folders that have copies of python executable and all python packages.

Virtualenvs can also avoid packages conflicts.

Create a virtualenv venv under folder /FinRL-Library

virtualenv -p python3 venv

To activate a virtualenv:

source venv/bin/activate


The script has been tested running under Python >= 3.6.0, with the folowing packages installed:

pip install -r requirements.txt


python --mode=train