Skip to content

Setup and installation

Assuming Make and a recent version of Python3 is installed on your machine, the easiest method of setting up the SDK is using the terminal to invoke:

  make setup

This will setup and activate a Python virtual environment, installing all necessary packages as defined within requirements.txt, and install an editable math-sdk module.

Manual installation

Create and Activate a Virtual Environment

It's recommended to use a virtual environment to manage dependencies. Using the Virtual Environment manager (venv), install Python version >=3.12 using:

python -m venv env
  • macOS/Linux:
source env/bin/activate
  • Windows:
venv \\scripts \\activate

Install Dependencies

Use pip to install dependencies from the requirements.txt file:

pip install -r requirements.txt

Install the Package in Editable Mode

Using the setup.py file, the package should be installed it in editable mode (for development purposes) with the command:

pip install -e .

This allows modifications to the package source code to take effect without reinstallation.

Verify Installation

You can check that the package is installed by running:

pip list

or testing the package import in Python:

python
>>> import your_package_name

Deactivating the Virtual Environment

When finished, deactivate the virtual environment with:

deactivate

Installing Cargo (Only if using Optimization Algorithm)

If the optimization algorithm is being utilized, Rust and Cargo should be installed.

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh