/
Install the Shogun Live Python module

Install the Shogun Live Python module

To use Python and the Shogun Live Python module, you must first install them.

Both Python 2 and Python 3 are supported. Vicon recommends that you use the latest full release of Python 3, unless your project requires you to use a specific version of Python.

Note
With Shogun 1.4 and later, Python 3.0 and later is fully supported. Legacy support only is provided for Python 2.7.

Install Python

To install Python 2 or 3:

  1. Go to Python.org/Downloads/
  2. Locate the required version and install Python, ensuring that Add Python #.# to PATH is selected:

Install the Python module

To install the Python module:

  1. Locate the installation files, which, if you installed Shogun Live in the default location, are found in this folder:

    C:\Program Files\Vicon\ShogunLive#.#\SDK\Python
    These files are displayed:

  2. You can install the Shogun Live Python module in either of the following ways, depending on your particular installation:

    • The simplest way is to run the batch file (install_shogun_live_api.bat) that is included in the Shogun Live installation (as shown in the above image). This usually works well if:

      • Python was installed to the PATH variable; or

      • Multiple versions of Python are installed but you want to install the API to the latest version that you installed; or

      • Only a single version of Python is installed.

      If any of these conditions apply, install the Python module by running the batch file.

    • In all other cases, install the Python module by using pip. This usually applies if:

      • Multiple versions of Python are installed but you want to install to a specific version; or

      • Multiple different versions of Python are installed and you want to install to all of them (in this case, you must install the module for each version); or

      • Only a single version of Python is installed, but you didn't install to PATH.

      If any of these conditions apply, install the Python module by running pip.

Install the Python module by running the batch file

  1. Navigate to the Python install folder:

    C:\Program Files\Vicon\ShogunLive#.#\SDK\Python

  2. Double-click install_shogun_live_api.bat.

    The installation process initializes automatically.

Alternatively, to run the batch file in a cmd window, enter install_shogun_live_api.bat.

Install the Python module by running pip

Important
If you are using Python 3, you must copy the SDK folder from the Program Files directory to a new folder that doesn't require Administrator permission. This is due to a permissions issue with pip versions 21.3 or later.

By default, you can find the SDK folder at C:\Program Files\Vicon\ShogunLive#.#\SDK (if you installed Shogun in another location, use this path to find the SDK folder).

We recommend copying the SDK folder into a new folder with an easy-to-access location, for example, C:\ShogunLiveAPI. You can delete this folder after the pip installation is complete.

The steps in this guide assume you have copied the SDK folder to C:\ShogunLiveAPI.

  1. Navigate to the Scripts folder for the version of Python that you want to use for pip installation.

    • The default installation folder for Python 3 is:

      C:\Users\ <user> \AppData\Local\Programs\Python\Python<version>\Scripts

    • The default installation folder for Python 2.7 is:

      C:\Python27\Scripts

  2. Open a command window or powershell in that folder.
  3. Run the following command to install the Vicon Core API (assuming you have copied the SDK folder to the suggested location):

    .\pip.exe install "C:\ShogunLiveAPI\SDK\Python\vicon_core_api"
  4. Run the following command to install the Shogun Live API (assuming you have copied the SDK folder to the suggested location):

    .\pip.exe install "C:\ShogunLiveAPI\SDK\Python\shogun_live_api"

Note
The above examples use a Python 3.11 installation with Shogun 1.13. Your path and commands may differ slightly.

Check that the Python module installed correctly

Check that the following modules have been installed:

  • vicon_core_api: This is the core remote control API and includes a client for communication with the terminal server.
  • shogun_live_api: Services API for accessing Shogun Live specific application functionality.

To test that the Shogun Python module has installed correctly, try importing one of the modules in Python:

>>> import vicon_core_api

If the above process fails to recognize the module, try the following:

  • Check the site-packages folder in the Python installation for the shogun_live_api or vicon_core_api folder. For Python 3.11, the location of the default installation folder is:
    C:\Users\<username>\AppData\Local\Programs\Python\Python311\Lib\site-packages
  • Check your system environment variables and ensure that the scripts folder for the Python installation you want to use is the highest in the list. For Python 3.11, the default location of the installation folder is:
    C:\Users\<username>\AppData\Local\Programs\Python\Python311\Scripts

If either of the modules folders is missing, and you have verified the path, re-run through the installation process described in Installing the Python module.