Exercises in reinforcement learning.
- Clone Repository.
git clone https://github.com/djjh/reinforcement-learning-labs
- Go to working directory. All steps assume you are working from
/path/to/repo-directory
.cd reinforcement-learning-labs
brew install pyenv
- Install required headers on Mac OSX Mojave. Without this step, you may see this error while installing python versions:
'zipimport.ZipImportError: can't decompress data; zlib not available
.Sources:open /Library/Developer/CommandLineTools/Packages/ macOS_SDK_headers_for_macOS_10.14.pkg
- Install python 3.6.3. On Mac OSX you must also enable a framework build to use matplotlib.
Sources:
env PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install 3.6.3
-
Enable the new version of python you just installed.
pyenv local 3.6.3
If you want to use this new version by default, then:
pyenv global 3.6.3
-
Create the virtual environment. Note that you must use
venv
to be able to use the framework build of python you just installed.cd /path/to/repo-directory mkdir virtual-environment cd virtual-environment python -m venv --prompt reinforcement-learning-labs .
-
Enable the virtual environment.
source bin/activate
-
Install dependencies using pip.
pip install -e ..
All steps assume you are in working directory /path/to/repo-directory
.
cd reinforcement-learning-labs
pyenv local 3.6.3
source virtual-environment/bin/activate
To run an experiment:
python -m experiments.<experiment_name> # e.g. python -m experiments.03_basic
- python setup scripts: https://docs.python.org/3.6/distutils/setupscript.html
- pytest good practices: https://docs.pytest.org/en/latest/goodpractices.html
- python import traps: http://python-notes.curiousefficiency.org/en/latest/python_concepts/import_traps.html