Installation Guide
Welcome! This page will help you set up a local Python development environment for working with the Treble SDK.
- If you're comfortable with Python and virtual environments, jump straight to the TL;DR for the minimum installation requirements.
- You can find videos of installations in the installation videos section.
- The videos pair well with the tutorial in the full installation guide.
This setup guide is cross-platform and designed to support Windows, macOS, and Linux. If you are on a Windows machine, we recommend using Ubuntu with WSL. If you choose this approach, after installing WSL, you may follow the installation guide for the Linux/WSL OS.
These installation guides assume you have already downloaded your credential file and the installation file from the management portal sent to you in the onboarding email!
Installation videos
- Windows
- macOS
- Linux/WSL
Video coming soon ...
Note! You can follow along with the videos by using the instructions of the next section.
Full installation guide
The Treble SDK is a Python library and 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:
- Windows
- macOS
- Linux/WSL
If you have not used the terminal before, you may be prompted to install Xcode Command Line Tools in order to run this command. Follow the prompts in the terminal to install the package, and then try the previous prompts again.
Different versions of Ubuntu ship with different Python versions. You can check the version available for your version by running the following in your shell:
python3 --version
sudo apt update
apt show python3
If you don't already have Python on your machine, or if you have an older version, download and install Python.
Installing Python
- Windows
- macOS
- Linux/WSL
- In PowerShell, type
python
and press Enter to open the Microsoft Store's installation page for Python, then follow any installation instructions. - Check the installation has happened successfully by re-running the PowerShell command:
python3 --version
Download a more recent Python version from http://www.python.org and follow the installation instructions.
When the Finder opens the location of the python files, double click on the file "Update Shell Profile.command" to update the terminal.
Close the earlier terminal windows, and in a new window, run the terminal command to verify a successful installation:
python --version
Install python by running the following in your shell:
sudo apt install python3 python3-pip python3-venv
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 macOS or Linux/WSL and under C:\Users\<YourUsername>\venvs\TrebleSDK
on Windows.
To create and activate a virtual environment named TrebleSDK:
- Windows
- macOS
- Linux/WSL
In PowerShell, run:
python -m venv C:\Users\<YourUsername>\TrebleSDK
C:\Users\<YourUsername>\TrebleSDK\Scripts\Activate.ps1
You may need to run the PowerShell as an administrator in order to set the PowerShell execution policy. If this is the case, open a new PowerShell window as an administrator by right-clicking on the icon and selecting "Run as Administrator", and run the following commmand.
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
In the terminal, run:
python3 -m venv ~/.venv/TrebleSDK
source ~/.venv/TrebleSDK/bin/activate
python3 -m venv ~/.venv/TrebleSDK
source ~/.venv/TrebleSDK/bin/activate
To deactivate your virtual environment, run deactivate
in your terminal/PowerShell.
Installing the SDK package
Save the installation file (.whl) in your working directory.
If you are using a virtual environment, ensure it is activated before installing the SDK and its dependencies by running:
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.
Optional dependencies
Many of the examples in our documentation are available as Jupyter notebooks.
For the best experience with the example notebooks, install the Jupyter notebook kernel using:
pip install jupyter
Storing your credentials
There are many ways to use the credential file (.cred) with the SDK, which are discussed in more detail in the Credentials Guide. The SDK will automatically check the following locations for credential files, so please make the appropriate directories and copy the credential file there.
- Windows
- macOS
- Linux/WSL
%userprofile%\AppData\Local\treble\tsdk\tsdk.cred
~/.config/treble/tsdk.cred
Linux/WSL: ~/.config/treble/tsdk.cred
Opening the example notebooks
You may use any code interface to work with the SDK, but we recommend Visual Studio Code if you don't yet have a preferred IDE.
Using VSCode
Open the working directory as a project in VSCode, and select your notebook (.ipynb). If this is your first time using VSCode, the IDE will suggest installing the "Python" extension.
- Use
Ctrl+Shift+P
to open the Command Palette, and search for "Select Interpreter". Choose the python environemnt you have installed the SDK within. - Now press "Select Kernel". If you have not yet installed it, you will be prompted to install the "Jupyter" extension. Once the extension is installed,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.
TL;DR (Quick Start)
The SDK officially supports Python versions 3.10, 3.11, 3.12, and 3.13.
The default credential storage location depends on the OS:
Windows: %userprofile%\AppData\Local\treble\tsdk\tsdk.cred or %userprofile%\AppData\Roaming\treble\tsdk\tsdk.cred
Linux: ~/.config/treble/tsdk.cred
Macos: ~/.config/treble/tsdk.cred or ~/Library/Application Support/treble/tsdk.credInstall the SDK and its dependencies by saving the
.whl
file in your working directory and runningpip install treble_tsdk-<VERSION>-py3-none-any.whl
In your IDE of choice, or run the following Python commands to initialise the SDK for the first time.
from treble_tsdk.tsdk import treble
tsdk = treble.TSDK()