Skip to content

Getting Started

Before running any forecast, prepare your computer so that the CPM Tool can run in its own Python environment.

  1. Check that your machine meets the System Requirements.
  2. Follow Installation and Setup to install the software

System Requirements

Python Visual Studio Code

Requirement Minimum
Python Version 3.12 or later
Code editor Microsoft Visual Studio Code
Memory At least 8 GB of RAM

Installation and Setup

Follow these steps once on each computer that will run the CPM Tool.

CPM Tool Setup


Step-by-step

  1. Download and install Python 3.12 or later.
  2. Download and install Microsoft Visual Studio Code.
  3. Create a new folder in drive C and name it CPM_Tool.

    CPM Tool folder

  4. Extract CPM_tool.zip to C:/CPM_Tool.

  5. Open Visual Studio Code. CPM Tool folder

  6. Go to File › Open Folder, then select C:\CPM_Tool.

  7. Open terminal. Go to View › Terminal.

  8. Create the CPM tool Python environment. Enter the following command in the terminal:

    python -m venv cpm_venv
    
    python3 -m venv cpm_venv
    

    Check the explorer

    Verify in the Visual Studio Code explorer that the cpm_venv directory now exists.

  9. Activate the environment. Enter the following command in the terminal:

    cpm_venv\Scripts\activate
    
    source cpm_venv/bin/activate
    

    Activate first

    The terminal prompt should show (cpm_venv) before you install packages.

  10. Install the required Python packages listed in requirements.txt. Enter the following command in the terminal:

    pip install -r docs/requirements.txt
    
    pip install -r docs/requirements.txt
    

    Python package dependencies docs/requirements.txt

    Check that all the packages listed below are installed in the cpm_venv\Lib\site-packages (for Windows) or cpm_venv/lib/python3.x/site-packages (for macOS) folder.

        timescroll >= 0.6.1
        macrotap >= 0.3.0
        datapie >= 0.6.3
        irispie-ce >= 0.79.5
        loguru
        ipython
    
  11. Test run. Enter the following command in the terminal:

    python -m us.run_all
    
    python3 -m us.run_all
    
  12. Chart generation confirms that the setup is complete. CPM Tool folder


Troubleshooting

  1. Fails to Install daqp

    CPM Tool setup error 1

    This error happens because pip is trying to compile the Python package daqp from source (building a wheel). This requires a C/C++ compiler and build tools (such as a C++ compiler or CMake) that are missing or not properly configured in your Windows PowerShell environment.

    Here is how to fix it.

    Install pre-built wheels or Microsoft C++ Build Tools

    The easiest way is to make sure pip can download a pre-compiled wheel, or to install the required build tools so it can compile.

    Step 1: Upgrade pip, setuptools and wheel

    First step

    Run the following command to make sure your package installers are up to date. This often allows pip to fetch compatible pre-compiled binaries:

    python -m pip install --upgrade pip setuptools wheel
    

    Verification

    Check that the output shows successfully updated versions of pip, setuptools and wheel.

    Step 2: Install Microsoft C++ Build Tools (if compilation is required)

    Alternative method

    If an up-to-date wheel isn't available for your Python version, you need the compiler toolchain:

    1. Download the Visual Studio Build Tools.
    2. During installation, select the workload "Desktop development with C++".
    3. Complete the installation and restart your terminal.

      Verification

      Run cl in PowerShell to check that the Microsoft C/C++ compiler is accessible in your path.

  2. Failed to activate environment cpm_venv

    CPM Tool setup error 2

    This error occurs because PowerShell restricts running scripts by default for security reasons. The safest and easiest way to fix this is to change the execution policy for your current terminal session only.

    Step 1: Bypass the execution policy for the current session

    Recommended and least invasive

    Run this command in your PowerShell terminal to allow scripts to run in the current window:

    Set-ExecutionPolicy Unrestricted -Scope Process
    

    Verification

    Type Get-ExecutionPolicy -Scope Process and confirm that it returns Unrestricted.

    Step 2: Activate the virtual environment

    Now run your activation command again:

    cpm_venv\Scripts\activate
    
    source cpm_venv/bin/activate
    

    Verification

    Check that your terminal prompt now starts with (cpm_venv).