Setting up Python
Get your computer ready to work with Python and your collection data
This page walks you through everything you need to work with our software from Python. You will install an editor, Python itself, the .NET platform our software runs on and the Double Dig IT Python SDK. Finally, you will run a short test script to check that everything works.
Allow about half an hour. Using a laptop managed by your organisation? Step 3 requires administrator rights, so you may want to ask your IT department for help. Stuck somewhere? The steps include a Not working? section that explains what to do.
This guide is for macOS. Using Windows? See the steps for Windows.

Install Visual Studio Code
Visual Studio Code (VS Code) is a free editor from Microsoft for writing, running and debugging Python scripts. It is lightweight and works well with both Python and .NET.
- Download VS Code for macOS from code.visualstudio.com/download.
- Open the downloaded zip file and drag Visual Studio Code to your Applications folder.
- Start VS Code and open Extensions from the bar on the left (or press Cmd+Shift+X).
- Search for Python and install the Python extension by Microsoft.
Opening a terminal
In the next steps you will type a few commands in a terminal. In VS Code, open one from the View > Terminal menu, or press Ctrl+`. A line where you can type commands then appears at the bottom of the window.
Every code block on this page has a button to copy its contents. Paste the command into the terminal with Cmd+V and press Enter.
Install Python
Python is the programming language itself. On a Mac, you install Python with the installer from the official Python website.
- Go to python.org/downloads and click Download Python.
- Open the downloaded file and follow the installer.
- Quit VS Code completely (every window) and start it again. VS Code only picks up newly installed programs after a restart.
-
Check that Python works by asking for its version number. On a Mac, the command is called
python3.
Already have Python installed? Just check the version number. Version 3.11 or newer is fine.
python3 --versionPython 3.15.0A higher version number is fine too.
Not working?
command not found: python-
On a Mac, the command is
python3rather thanpython. Already usingpython3? Then quit VS Code completely and start it again, so the new installation is picked up.
Install the .NET 10 Runtime
Our software is built on .NET, Microsoft's software platform. To use it from Python, your computer needs the .NET 10 Runtime.
- Go to the .NET 10 Runtime download page.
- Select the macOS tab at the top if it isn't selected already. Under Run console apps, click Download Arm64 (Apple Silicon) if your Mac has an Apple chip (M1, M2 and so on), or Download x64 (Intel) if it has an Intel processor. You can check which one you have via the Apple menu > About This Mac.
- Open the downloaded file and follow the installer. You will need your administrator password.
- Quit VS Code completely (every window) and start it again. VS Code only picks up newly installed programs after a restart.
- Check the installation with the command for this step.
Already have the .NET 10 SDK? It includes the runtime, so you can skip this step.
dotnet --list-runtimes
The list should contain a line starting with Microsoft.NETCore.App 10.0, for example:
Microsoft.NETCore.App 10.0.13 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]Not working?
dotnetis not recognised- Close every VS Code window and start VS Code again. Still not working? Run the .NET installer again and check that the installation finished completely.
- There is no line with
Microsoft.NETCore.App 10.0in the list - You do have .NET, but not version 10. Install the .NET 10 Runtime as described above. Other versions can stay installed.
Install the Double Dig IT Python SDK
The Python SDK contains the software that lets Python work directly with your collection data. Python talks to this .NET software through the pythonnet package, which you also install in this step.
- Download the Python SDK using the button below.
-
Double-click the zip file in your Downloads folder (Safari sometimes does this for you).
Then drag the
DDigit-Python-SDKfolder to your home folder, which you can open in the Finder via Go > Home. - Install pythonnet with the command for this step.
Prefer a different location? That's fine. Just remember where you put the SDK, because you will need that path in step 5.
python3 -m pip install pythonnet
The installation ends with a line starting with Successfully installed.
Seeing Requirement already satisfied instead? Then pythonnet was already installed, which is fine too.
Test your setup
Now everything comes together. You will create a working folder with two small Python files and run a test.
-
Create a folder for your scripts, for example
~/Python-CollectionData, and open it in VS Code with File > Open Folder. If VS Code asks whether you trust the authors of the files in this folder, choose Yes, I trust the authors. -
Open the Explorer on the left (or press Cmd+Shift+E).
Next to the name of your folder, click the New File icon, type
ddigit_bootstrap.pyand press Enter. -
Paste the matching code into the file and save it with Cmd+S. This file loads our
software, so your own scripts only need to import it. Put the SDK somewhere else? Then change the path at
sdkPath. -
Create the file
test_setup.pyin the same way, paste its matching code and save it. -
Make sure
test_setup.pyis open and click inside it. A play button (Run Python File) then appears in the top right of the editor, above the code. Click it.
You can also run the test script by typing python3 test_setup.pyin the terminal.
Do you see the word "Success!" appear in the terminal? Then your computer is ready to work with Python and collection data.
import osimport sys# change this path if you put the SDK somewhere elsesdkPath = os.path.expanduser("~/DDigit-Python-SDK/dotnet")# add the SDK folder to the Python search pathsys.path.insert(0, sdkPath)# load the .NET runtime with the configuration from the SDKfrom pythonnet import loadload("coreclr", entry_dll=os.path.join(sdkPath, "DDigit.PythonHost.dll"))# load the Double Dig IT DataProviderimport clrclr.AddReference(os.path.join(sdkPath, "DDigit.DataProvider.dll"))import sysimport ddigit_bootstrapfrom DDigit.DataProvider import DDataProviderdataProvider = DDataProvider()print("Python", sys.version.split()[0])print("Success! The Double Dig IT Python SDK is working.")Python 3.15.0
Success! The Double Dig IT Python SDK is working.Not working?
- I can't see the play button
-
The button only appears while a Python file is open and active. Click inside
test_setup.pyand check that the file has been saved with a name ending in.py. Is there a Restricted Mode notice at the top? Click it and choose to trust the folder. Also check that the Python extension from step 1 is installed. Or run the script from the terminal as described above. ModuleNotFoundError: No module named 'pythonnet'- Pythonnet is not yet installed for the Python version VS Code is using. Run the command from step 4 again. Then, in VS Code, press Cmd+Shift+P > Python: Select Interpreter and choose the same Python version as in the terminal.
ModuleNotFoundError: No module named 'ddigit_bootstrap'-
Python cannot find
ddigit_bootstrap.py. Make sure it is in the same folder astest_setup.pyand that the file name is spelled exactly right. RuntimeError: Can not determine dotnet root- Python cannot find .NET. Usually the .NET 10 Runtime has not been installed yet, so go through step 3. Installed .NET in another way, for example with Homebrew? Then install it again with the installer from step 3, so it ends up in the standard location.
RuntimeError: Failed to create a .NET runtime (coreclr)-
Python cannot find .NET or the SDK. Check that the folder in
ddigit_bootstrap.pycontains the fileDDigit.DataProvider.dll. Make sure you did not accidentally create an extra folder while extracting, such asDDigit-Python-SDK/DDigit-Python-SDK. Is the path correct? Then check step 3 and restart VS Code.
Still stuck? Get in touch and include the full error message, and we will help you out.
Learning Python
Want to learn more about Python itself? The official Python tutorial is a good place to start.