Installation
Prerequisites
- Python 3.10 or higher
- uv (recommended) or pip
Quick Install
Environment Setup
QuantRL-Lab requires API keys for data sources. Copy the example environment file:
Edit .env and add your API keys:
# Alpaca Trading API (for data & live trading)
ALPACA_API_KEY=your_key_here
ALPACA_SECRET_KEY=your_secret_here
ALPACA_BASE_URL=https://paper-api.alpaca.markets # Paper trading
# Alpha Vantage (for alternative data)
ALPHA_VANTAGE_API_KEY=your_key_here
Getting API Keys
- Alpaca: Sign up for free (paper trading account)
- Alpha Vantage: Get free API key
YFinance requires no API key
The YFinanceDataLoader works out of the box with no configuration.
It's the easiest way to get started.
Verify Installation
# Check imports
python -c "from quantrl_lab import environments, data, experiments; print('Installation successful')"
# Run tests
pytest
Jupyter Setup (Optional)
For running notebooks:
# Install Jupyter kernel
python -m ipykernel install --user --name quantrl-lab --display-name "QuantRL-Lab"
# Start Jupyter
jupyter notebook
# Then select "QuantRL-Lab" kernel in notebook
Troubleshooting
Import Error: ModuleNotFoundError: No module named 'quantrl_lab'
Ensure you're in the virtual environment:
Next Steps
- Quickstart Guide - Train your first agent
- Configuration - Customize environment settings
- Examples - Explore notebooks