Installation Guide
Installing Python
If you don't already have Python, download and install Python.
Note: The SDK officially support Python versions 3.9, 3.10, 3.11, 3.12 and 3.13
Installing Python on Windows:
Option A: Installing Python
You can either install python via the Microsoft Store or download python from www.python.org. If you prefer using a solution such as Anaconda then the SDK supports that as well.
Option B: Installing Python using Anaconda:
Install Anaconda from https://docs.anaconda.com/free/anaconda/install/windows/. Open Anaconda prompt and create an anaconda environment for the SDK (replacing <ENVIRONMENT_NAME> with the name you choose for the environment):
conda create -n <ENVIRONMENT_NAME> python=3.10 anaconda
Enable the environment
conda activate <ENVIRONMENT_NAME>
Install Python on Linux (Ubuntu):
You can either install Python using the Ubuntu package manager or using 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, 3.10 or 3.9 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.10 python3.10-venv
Option B: Using Miniconda
Install Miniconda from https://docs.conda.io/projects/conda/en/latest/user-guide/install/linux.html.
Open a terminal and create a conda environment for the SDK (replacing <ENVIRONMENT_NAME> with the name you choose for the environment):
conda create -n <ENVIRONMENT_NAME> python=3.10
Activate the environment:
conda activate <ENVIRONMENT_NAME>
Now you should be able to run the installation of the SDK
Install python on MacOS:
The installation instructions for Ubuntu should work the same way for MacOS except that care should be taken to install the correct version based on whether the Mac has an intelbased processor or an M-type processor (https://docs.conda.io/projects/miniconda/en/latest/).
Alternatively MiniForge (https://conda-forge.org/miniforge/) can also be used to install Python if the Mac has an M-type processor.
The preparation should then work the same as for Ubuntu:
Open a terminal and create a conda environment for the SDK (replacing <ENVIRONMENT_NAME> with the name you choose for the environment):
conda create -n <ENVIRONMENT_NAME> python=3.10
Activate the environment:
conda activate <ENVIRONMENT_NAME>
Now you should be able to run the installation of the SDK
Installing the SDK package
We suggest working in a Python or conda virtual environment when installing the SDK.
If you are using Anaconda or Miniconda you will use conda to create your virtual environment (See installation instructions above.), if you are using Python without conda see: https://docs.python.org/3/library/venv.html for instructions on how to create virtual environments.
Note: The SDK depends on a package called Rhino3dm for model import/export, we suggest users install it from a whl file (using pip install) before the SDK to prevent pip trying to build the Rhino3dm library from source. Please see notes in Appendix Installing the rhino3dm dependency
To install the SDK and it's dependencies, save the whl file on your working directory and run:
pip install treble_tsdk-<VERSION>-py3-none-any.whl
Installing optional dependencies
For a smoother experience when running the examples in the Jupyter notebooks provided you may want to install these additional packages: A Jupyter notebook kernel:
pip install notebook
For better in-line plotting 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.
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.
Appendix: Installing the rhino3dm dependency
The SDK depends on a package called Rhino3dm for model import/export, we suggest uses install it from a whl file (using pip install) before the SDK to prevent pip trying to build the Rhino3dm library from source.
The whl files can be found here: https://pypi.org/project/rhino3dm/7.15.0/#files f.ex.
- rhino3dm-7.15.0-cp310-cp310-win_amd64.whl for Python 3.10 on windows.
- rhino3dm-7.15.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl for Python 3.9 on linux.
If there are no whl files available for your OS+Python combo you will need to install the build dependencies of Rhino3dm. On ubuntu this can be done using the following commands:
sudo apt install cmake build-essential
You can then run
pip install rhino3dm
to install the package, note that building the package will take a while.