# Installation

## Quick Install

Recommended: install in a virtual environment (venv/conda) to avoid dependency conflicts.

Note: DeGirum PySDK is installed from DeGirum’s package index at [https://pkg.degirum.com](https://pkg.degirum.com/) (this is the preferred install source).

```bash
pip install -i https://pkg.degirum.com degirum
```

Detailed, platform-specific installation steps (OS, accelerators/runtimes, troubleshooting) are provided in the [#installation-options](#installation-options "mention") section.

{% hint style="danger" %}
Starting with PySDK version 1.0.0, PySDK is governed by new [EULA](https://docs.degirum.com/pysdk/eula). Please read the new EULA before installing/upgrading.&#x20;
{% endhint %}

### Token installation and license

Starting from ver. 1.0.0, the usage of premium runtime plugins requires license. The license is obtained automatically by PySDK from DeGirum AI Hub if you have AI Hub token installed on your system. Once requested, the plugin license is stored locally and automatically renewed on expiration. Default expiration period is 10 days. The license is node-locked.

The Free plan allows you to use PySDK premium runtimes on **one host**. If you need to use PySDK premium runtimes on more than one host, you need to upgrade your AI Hub workspace to [Professional or Enterprise plans](https://degirum.com/pricing).

To install existing AI Hub token, you run `degirum` CLI command: `degirum token install <TOKEN>` where `<TOKEN>` is the AI Hub token string which you generate on [AI Hub](https://docs.degirum.com/ai-hub/workspaces/workspace-tokens).

To create new token and install it, you run `degirum` CLI command: `degirum token create`. If you run this command on a system having graphical desktop, it will open token generation page in your default browser for you. Otherwise it will print URL which you need to paste in any browser.

To upgrade your plan, follow [these instructions](https://docs.degirum.com/ai-hub/workspace-plans#upgrade-your-workspace-plan).

The premium plugins include:

* Akida (Brainchip)
* Axelera
* DeepX
* Hailo
* MemryX
* ONNX
* OpenVINO (Intel)
* Renesas
* RKNN (RockChip)
* TensorRT (NVIDIA)

Free plugins include DeGirum N2X Orca and Google TFLite.

## Supported Environments

PySDK currently supports these operating systems, CPU architectures, and Python versions.

<table><thead><tr><th width="306">Operating System</th><th>Supported CPU Architectures</th><th>Supported Python Versions</th></tr></thead><tbody><tr><td>Ubuntu Linux 20.04, 22.04, 24.04</td><td>x86-64</td><td>3.9 ... 3.13</td></tr><tr><td>Ubuntu Linux 20.04, 22.04, 24.04</td><td>ARM AArch64</td><td>3.9 ... 3.13</td></tr><tr><td>Raspberry Pi OS (64 bit)</td><td>ARM AArch64</td><td>3.9 ... 3.13</td></tr><tr><td>Windows 10/11</td><td>x86-64</td><td>3.9 ... 3.13</td></tr><tr><td>macOS</td><td>ARM AArch64</td><td>3.9</td></tr></tbody></table>

## Supported Hardware

Below is a summary of what hardware we support, including the runtime, devices, and model binary formats.

| Vendor     | Runtime  | Devices                | Model Binary Format |
| ---------- | -------- | ---------------------- | ------------------- |
| Hailo      | HAILORT  | HAILO8, HAILO8L        | .hef                |
| Axelera AI | AXELERA  | Metis                  | .bin, .json, & .c   |
| DEEPX      | DEEPX    | M1A                    | .dxnn               |
| Intel      | OPENVINO | CPU, GPU, NPU          | .onnx, .bin & .xml  |
| Renesas    | RENESAS  | RZ-V2N                 | .so                 |
| Rockchip   | RKNN     | RK3588, RK3568, RK3566 | .rknn               |
| MemryX     | MEMRYX   | MX3                    | .dfp                |
| BrainChip  | AKIDA    | NSoC\_v2, AKD1500      | .bin                |
| Google     | TFLITE   | EDGETPU                | .tflite             |
| DeGirum    | N2X      | ORCA1                  | .n2x                |
| NVIDIA     | TENSORRT | DLA, GPU               | .onnx               |
| AMD        | ONNX     | VITIS\_NPU             | .onnx               |

## Installation Options

We recommend creating a Python virtual environment for PySDK and other DeGirum Python packages.

Open a command prompt or terminal, then follow the steps for your system below.

### Windows

If Python is not installed, disable the Windows Python App Execution Alias before installing Python and PySDK. Ensure the [Visual C++ Redistributable for Visual Studio 2015 or later](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170) is installed.

<details>

<summary><strong>Disabling the Windows Python App Execution Alias and Installing Python on Windows</strong></summary>

1. **Locate the Alias:** By default, Windows will overwrite `python` with Python from the Microsoft Store when entered in a terminal. Search for App Execution Alias in Windows Settings and disable both `python.exe` and `python3.exe` aliases.

<figure><img src="https://2601997817-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FadsCjYOHkzN6JzhjwIb1%2Fuploads%2Fgit-blob-982b0908e4feeedd3e427879e23848074f0eb2f5%2Fpysdk--windows-python-app-execution-aliases.png?alt=media" alt=""><figcaption><p><strong>Windows Python App Execution Aliases for</strong> <code>python.exe</code> and <code>python3.exe</code> .</p></figcaption></figure>

2. **Install a Python version supported by PySDK:** After disabling the App Execution Alias, install Python from the [official Python website](https://www.python.org/downloads/) or with `winget`. When installing with [winget](https://learn.microsoft.com/en-us/windows/msix/app-installer/install-update-app-installer), include both `Python.Python.<version>` and `Python.Launcher`.

</details>

**Installing PySDK in a Python Virtual Environment on Windows**

Ensure a supported Python version is installed, then watch the video or follow the steps below:

{% embed url="<https://youtu.be/eVfWq8xbo-c>" %}
Windows Installation
{% endembed %}

{% stepper %}
{% step %}
**Create a Python Virtual Environment**

Use this command to create a virtual environment with the default Python installation:

{% code overflow="wrap" %}

```powershell
cd ~
python -m venv degirum-windows
```

{% endcode %}

Alternatively, with Python Launcher (explicit 3.12):

{% code overflow="wrap" %}

```powershell
py -3.12 -m venv degirum-windows
```

{% endcode %}
{% endstep %}

{% step %}
**Activate the Python Virtual Environment**

After creating the environment with `venv`, navigate to the `Scripts` folder in your virtual environment.

{% code overflow="wrap" %}

```powershell
cd ~\degirum-windows\Scripts
```

{% endcode %}

Once in that folder, run the activation command.

On cmd.exe:

{% code overflow="wrap" %}

```powershell
activate
```

{% endcode %}

On pwsh.exe:

{% code overflow="wrap" %}

```powershell
.\Activate.ps1
```

{% endcode %}

After activation, the virtual environment name appears before the terminal prompt.

<figure><img src="https://2601997817-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FadsCjYOHkzN6JzhjwIb1%2Fuploads%2Fgit-blob-fc5a5be6e528c2fb4c3997208b95c02f2455d1e2%2Fpysdk--powershell-active-degirum-windows-venv.png?alt=media" alt=""><figcaption><p>PowerShell terminal with an active <code>degirum-windows</code> virtual environment</p></figcaption></figure>
{% endstep %}

{% step %}
**Install PySDK with `pip install`**

With the environment active, use `pip` to install PySDK and optionally `degirum-tools`. The PySDK package is `degirum`, while `degirum-tools` helps you build AI applications with PySDK.

To install only PySDK:

{% code overflow="wrap" %}

```powershell
pip install -i https://pkg.degirum.com degirum
```

{% endcode %}

To install both PySDK and `degirum-tools`:

{% code overflow="wrap" %}

```powershell
pip install -i https://pkg.degirum.com degirum degirum-tools
```

{% endcode %}
{% endstep %}

{% step %}
**Verify PySDK Installation**

Run this command in the active virtual environment:

{% code overflow="wrap" %}

```python
degirum sys-info
```

{% endcode %}

Example output:

{% code overflow="wrap" %}

```powershell
(degirum-windows) PS C:\degirum\degirum-windows\Scripts> degirum sys-info
Devices:
  N2X/CPU:
  - '@Index': 0
  TFLITE/CPU:
  - '@Index': 0
  - '@Index': 1
  - '@Index': 2
  - '@Index': 3
Software Version: 1.0.0
```

{% endcode %}

A list of detected devices confirms that PySDK is installed.
{% endstep %}
{% endstepper %}

### Linux

Ensure a Python version supported by PySDK is installed.

<details>

<summary>Installing Python on Linux</summary>

Commands vary by distribution. Use these examples as a guide.

For Ubuntu 24.04:

Update package lists and upgrade installed packages. Then, install Python and the `venv` module.

{% code overflow="wrap" %}

```bash
sudo apt update
sudo apt upgrade -y
sudo apt install -y python3 python3-venv
```

{% endcode %}

For Raspberry Pi OS:

You should only need to update package lists and upgrade installed packages. Python 3 is preinstalled on 64-bit Raspberry Pi OS.

{% code overflow="wrap" %}

```bash
sudo apt update
sudo apt upgrade -y
```

{% endcode %}

</details>

{% stepper %}
{% step %}
**Create a Python Virtual Environment**

Use this command to create a virtual environment:

{% code overflow="wrap" %}

```bash
cd ~
python3 -m venv degirum
```

{% endcode %}

Alternatively, to target Python 3.12 explicitly:

{% code overflow="wrap" %}

```bash
python3.12 -m venv degirum
```

{% endcode %}
{% endstep %}

{% step %}
**Activate the Python Virtual Environment**

After creating the environment with `venv`, activate it:

{% code overflow="wrap" %}

```bash
source ~/degirum/bin/activate
```

{% endcode %}

After activation, the virtual environment name appears before the terminal prompt.

<figure><img src="https://2601997817-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FadsCjYOHkzN6JzhjwIb1%2Fuploads%2Fgit-blob-2323d45271e8fea2df31cdf7f7867525790d68d9%2Fpysdk--terminal-active-degirum-venv.png?alt=media" alt=""><figcaption><p>Terminal with an active <code>degirum</code>virtual environment</p></figcaption></figure>
{% endstep %}

{% step %}
**Install PySDK with `pip install`**

With the environment active, use `pip` to install PySDK and optionally `degirum-tools`. The PySDK package is `degirum`, while `degirum-tools` helps you build AI applications with PySDK.

To install only PySDK:

{% code overflow="wrap" %}

```bash
pip install -i https://pkg.degirum.com degirum 
```

{% endcode %}

To install both PySDK and `degirum-tools`:

{% code overflow="wrap" %}

```bash
pip install -i https://pkg.degirum.com degirum degirum-tools 
```

{% endcode %}
{% endstep %}

{% step %}
**Verify PySDK Installation**

Run this command in the active virtual environment:

{% code overflow="wrap" %}

```python
degirum sys-info
```

{% endcode %}

Example output:

{% code overflow="wrap" %}

```bash
(degirum) root@dl4328:~# degirum sys-info
Devices:
  N2X/CPU:
  - '@Index': 0
  TFLITE/CPU:
  - '@Index': 0
  - '@Index': 1
  - '@Index': 2
  - '@Index': 3
Software Version: 1.0.0
```

{% endcode %}

A list of detected devices confirms that PySDK is installed.
{% endstep %}
{% endstepper %}

### Docker Images

We also provide Docker images for [DeGirum AI server](https://hub.docker.com/r/degirum/aiserver) and [PySDK AI client](https://hub.docker.com/r/degirum/aiclient) installations.

Follow [this GitHub link to DeGirum Docker repo](https://github.com/DeGirum/docker-degirum) for details on how to run these images and for corresponding source Dockerfiles.

## Runtimes and Drivers

We support multiple hardware options and runtime environments. PySDK comes with support for N2X and TFLite runtimes. Follow [this link](https://docs.degirum.com/pysdk/runtimes-and-drivers) for more details.

### Limiting Runtime Plugin Loading

PySDK searches for runtime plugins at startup. To restrict which plugins load,\
set the `DG_PLUGINS_ALLOWED` environment variable to a list of plugin prefixes\
separated by any non alphanumeric character. For example:

{% code overflow="wrap" %}

```bash
export DG_PLUGINS_ALLOWED=n2x_runtime_agent;onnx_runtime_agent
```

{% endcode %}

Only plugins with prefixes in the list load when `DG_PLUGINS_ALLOWED` is set.\
If the variable is not defined, all available plugins load as before.

Supported plugin prefixes include `hailort_runtime_agent`, `openvino_runtime_agent`, `axelera_runtime_agent`, `memryxrt_runtime_agent`, `akida_runtime_agent`, `tflite_runtime_agent`, `n2x_runtime_agent`, `rknn_runtime_agent`, `onnx_runtime_agent`, and `tensorrt_runtime_agent`.

## Verification

After installing runtimes and device drivers, verify PySDK on Windows 11 or Ubuntu 24.04 by running:

{% code overflow="wrap" %}

```bash
degirum sys-info
```

{% endcode %}

Example output (PowerShell, Windows):

{% code overflow="wrap" %}

```powershell
(degirum-windows) PS C:\degirum\degirum-windows\Scripts> degirum sys-info
Devices:
  N2X/CPU:
  - '@Index': 0
  TFLITE/CPU:
  - '@Index': 0
  - '@Index': 1
  - '@Index': 2
  - '@Index': 3
Software Version: 1.0.0
```

{% endcode %}

Example output (Linux):

{% code overflow="wrap" %}

```bash
(degirum) root@dl4328:~# degirum sys-info
Devices:
  N2X/CPU:
  - '@Index': 0
  TFLITE/CPU:
  - '@Index': 0
  - '@Index': 1
  - '@Index': 2
  - '@Index': 3
Software Version: 1.0.0
```

{% endcode %}

## Troubleshooting

If you encounter errors such as:

{% code overflow="wrap" %}

```bash
ERROR: Could not find a version that satisfies the requirement degirum
ERROR: No matching distribution found for degirum
```

{% endcode %}

Create a new virtual environment and reinstall PySDK.

You can also try upgrading `pip` with this command:

{% code overflow="wrap" %}

```bash
python3 -m pip install -U pip
```

{% endcode %}

On Windows, confirm that the [Visual C++ Redistributable for Visual Studio 2015 or later](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170) is installed.
