Skip to content

Setup and installation

Installing the Carrot MathEngine

This guide details the recommended process for installing the Carrot-MathEngine and all required packages using the setuptools standard package.

Step 1: 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:

python3.12 -m venv env

Activate the virtual environment:

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

Step 2: Install Dependencies

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

pip install -r requirements.txt

Step 3: 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.

Step 4: 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

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

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