Skip to main content

System requirements

Python 3.12 or later is required. The stakeengine package declares python_requires=">=3.12" and will not install on earlier versions.
If you have Make and Python 3.12+ installed, run:
This executes the following steps in order:
  1. python3 -m venv env — creates a virtual environment at env/.
  2. pip install --upgrade pip — ensures pip is up to date inside the environment.
  3. pip install -r requirements.txt — installs all dependencies (numpy, zstandard, boto3, pytest, xlsxwriter, matplotlib, and others).
  4. pip install -e . — installs the stakeengine package in editable mode so local source changes take effect immediately.
After setup, activate the virtual environment before running scripts directly:
make run GAME=<game_id> activates the virtual environment automatically. Manual activation is only needed when you run Python scripts directly.

Manual installation

If you prefer not to use Make, follow these steps.
1

Create a virtual environment

This creates an isolated Python environment at env/ in the project root.
2

Activate the virtual environment

Your shell prompt will change to show (env) when the environment is active.
3

Install dependencies

This installs all packages listed in requirements.txt, including:
  • numpy — array operations for reel and board math
  • zstandard — compressed .jsonl.zst book files
  • boto3 / botocore — optional S3 upload support
  • pytest — test runner
  • xlsxwriter — PAR sheet generation
  • matplotlib — analysis charts
  • python-dotenv — environment variable management
4

Install the package in editable mode

The -e flag installs the stakeengine package in editable (development) mode. Changes you make to the source files under src/ are reflected immediately without reinstalling.

Verify installation

Check that the package is listed:
Or confirm the import works:

Installing Rust / Cargo

Rust and Cargo are only required if you plan to run the optimization algorithm that adjusts simulation weights to hit a target RTP. If you are only running simulations or inspecting output, you can skip this step.
Follow the on-screen prompts. After installation, restart your terminal and verify:
See the Rust getting started guide for platform-specific instructions.

Deactivating the virtual environment

When you are done working, deactivate the virtual environment: