Skip to main content

Installation Guide

Installing Python

The Treble SDK is a Python library. If you don't already have Python on your machine, or if you have an older version, download and install Python.

The SDK officially supports Python versions 3.10, 3.11, 3.12 and 3.13.

To check if you have a supported version of Python installed, write either of these lines in your terminal or command window:

python --version
python3 --version

Option A: Use WSL

We recommend using Ubuntu with WSL on Windows. With that setup, follow the instructions on how to install on Linux.

Option B: Installing Python on Windows

You can either install python via the Microsoft Store or download python from www.python.org.

Option C: Installing Python using Anaconda:

Install Anaconda from https://docs.anaconda.com/free/anaconda/install/windows/.


Setting up a Virtual Environment

We recommend using a virtual environment when installing the SDK to keep dependencies isolated.

The virtual environment can be placed anywhere you want but we recommend placing it under ~/.venv/TrebleSDK on Mac or Linux and under C:\Users\<YourUsername>\venvs\TrebleSDK on Windows.

To create and activate a virtual environment named TrebleSDK:

Using PowerShell

python -m venv C:\Users\<YourUsername>\TrebleSDK\Scripts\Activate.ps1

Using cmd

python -m venv C:\Users\<YourUsername>\TrebleSDK\Scripts\Activate.bat

To deactivate the virtual environment

deactivate

Installing the SDK package

To install the SDK and its dependencies, save the .whl file in your working directory and run:

pip install treble_tsdk-<VERSION>-py3-none-any.whl

This will install the SDK and all dependencies in your current Python environment. Note that this might take a few minutes.

Installing optional dependencies

The example notebooks are run using Jupyter notebooks. For the best experience, you may install the Jupyter notebook kernel using:

pip install notebook

If you need pyvista plotting in-line in the notebooks install the following packages:

pip install trame trame-vuetify trame-vtk pythreejs

Opening the example notebooks

Using VSCode

Open the notebook in VSCode, code will suggest installing the "Python" extension if it's missing.

  • Press the "Select interpreter" button if visible at the bottom of the window. Choose the Python executable with the SDK installed.
  • Press the "Select kernel" button, if you're missing a kernel the "Jupyter" extension VSCode will suggest installing it.
    • Now under the "Select Kernel" dialog choose "Python Environments". Select the python environment with the SDK installed.

Now you should be ready to run the examples provided in the Jupyter notebooks using VSCode.

Using jupyter web UI

You can also run the Jupyter notebook using the jupyter-notebook command provided by the notebook python package. Within your python environment run this command:

jupyter-notebook

Which will open up a browser with a window into your directory structure from the directory where you ran the command. From there you can either create a new notebook or open an existing one.