pyCGM2 is implemented for python 3.9 to python 3.11.
Development and testing are primarily conducted with Python 3.10
You can install pyCGM2 in two different ways, depending on your needs:
User mode:
This option is recommended if you simply want to use pyCGM2 without modifying its source code. The installation is straightforward and uses the official conda channel.Developer mode:
Choose this option if you plan to contribute to pyCGM2 or need to make changes to the source code. You will download the source code and install pyCGM2 in “editable” mode, so any changes you make are immediately reflected.
Select the option below that best fits your use case and follow
User mode
To install pyCGM2 as a regular user, follow these steps:
Open the Anaconda Prompt (Miniconda)
You can find it in your Start menu or by searching “Anaconda Prompt”.Create a Python 3.10 virtual environment
Type the following command to create a new environment namedpycgm310:conda create --name pycgm310 python=3.10This step ensures that pyCGM2 runs in an isolated environment with the correct Python version.
Activate your new environment
Enable the environment with:conda activate pycgm310Install pyCGM2 from the conda channel
Run:conda install -c pycgm2 pycgm2This command downloads and installs pyCGM2 and its dependencies from the official pyCGM2 conda channel.
After installation, pyCGM2 will be available in your environment.
You can find the installed package in:PATH_TO_MINICONDA\envs\pycgm310\Lib\site-packages
Tip:
Using a virtual environment helps keep your Python projects organized and avoids conflicts
Developer mode
If you want to contribute to pyCGM2 or make changes to its source code, follow these steps to install pyCGM2 in developer mode:
Download the pyCGM2 source code
You have two options:- Download the latest release and unzip it,
or - Clone the master branch from GitHub using your preferred version control tool (GitHub Desktop, Sourcetree, etc.).
- Download the latest release and unzip it,
Open the Anaconda Prompt (Miniconda)
You can find it in your Start menu or by searching “Anaconda Prompt”.Navigate to the pyCGM2 folder
Use thecdcommand to go to the folder where you downloaded or cloned pyCGM2:cd path/to/my/pycgm2/folderCreate the pre-configured Python environment
Run:conda env create -f environment.ymlThis will create a Python 3.10 virtual environment named
pycgm310.
If you want to use a different name, use:conda env create -f environment.yml -n newNameThis command may require few minutes to check the compatibility of the provided environment
Activate your environment
conda activate pycgm310Install pyCGM2 in editable mode
Run:pip install -e .The
-eflag (“editable” mode) means any changes you make to the source code will be immediately available in your environment, without needing to reinstall.
If you move or rename the pyCGM2 package folder after installation, it will no longer be found by Python.
For vicon users - install the Nexus packages
If you are a Vicon Nexus User, type the command below to enable interaction with Vicon Nexus
pyCGM2-setup_NexusPackages.exe
pyCGM2-generate_pyCGM2_Nexus.exe
- The first command installs the Vicon-distributed Python packages into Nexus’s internal SDK folder.
- The second command creates a ready-to-use CGM2.3 pipeline that can be imported into Nexus. It is configured to activate your pyCGM2 environment using a script located in
C:/Users/YourName/AppData/pycgm2.
the first command may require to run in administrator mode the anaconda console
Afterwards, you can import the ready-to-use pyCGM23-{EnvironmentName}-CGM23.Pipeline into Nexus.
go to your nexus pipeline panel and select import

the pre configured pipeline is located in
C:\Users\Public\Documents\Vicon\Nexus2.x\Configurations\Pipelines
This pipeline includes pre-configured operations for running CGM2.3, gait event detection algorithms, and gap filling.
For QTM users - setup a pyCGM2 project
pyCGM2-QTM interactions leverages from QTM scripting and is only available from pyCGM2 version 4.3-rc3. The implementation may be subject to modifications.
Here is the flowchart to configure pyCGM2 with QTM
Download/clone a pycgm2 QTM project
Download or clone a pyCGM2 QTM project
Once install, you need to amend each bat file of the template folder
- open the downloaded project folder in your file explorer
- go to the folder Template
- edit and change
CONDA_PATHand ENV_NAME
if you do not know where is CONDA_PATH, open a conda console and type conda info
Configure_QTM
add event shorcuts
- go to Tools/project options.
- in the tree view, go to Miscellaneous/Events and add event shorcuts as described in this image

configure c3d export
- go to Tools/project options.
- in the tree view, go to Processing/C3d export and amend the settings to match those described in this image

enable pycgm2 menu
- go to Tools/project options.
- in the tree view, go to Miscellaneous/Scripting , add a script
- add the script
pycgm2-scripting.pylocated in the folderpyCGM2\Apps\QtmApps\qtm-scripting\ - tick the script and apply it

eventually, the pycgm2 menu will appear in the menu toolbar.