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
- Windows
- Mac
- Linux
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/.
python3 --version
If the version is less than 3.10, download Python from http://www.python.org and install.
You can either install Python using the Ubuntu package manager or Miniconda.
Option A: Using Ubuntu package manager
Different version of Ubuntu ship with different python versions. You can check the version available for your Ubuntu by doing:
sudo apt update
apt show python3
If the Version value displayed is 3.13, 3.12, 3.11 or 3.10 you can install python by doing
sudo apt install python3 python3-pip python3-venv
If the version value is lower or higher than the supported python version you will need to add a PPA which provides supported python versions f.ex. the deadsnakes PPA:
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.13 python3.13-venv
Option B: Using Miniconda
Install Miniconda from https://docs.conda.io/projects/conda/en/latest/user-guide/install/linux.html.
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:
- Windows
- Mac
- Linux
Using PowerShell
python -m venv C:\Users\<YourUsername>\TrebleSDK\Scripts\Activate.ps1
Using cmd
python -m venv C:\Users\<YourUsername>\TrebleSDK\Scripts\Activate.bat
python3 -m venv ~/.venv/TrebleSDK
source ~/.venv/TrebleSDK/bin/activate
python3 -m venv ~/.venv/TrebleSDK
source ~/.venv/TrebleSDK/bin/activate
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.