Building a Python Interpreter from Source with a Docker Image on Linux

You can build a Python interpreter from source using a Docker image on Linux, and then place the Python interpreter in an SPK deployment on a Spotfire Server running on Linux.

Perform this task from the command line on a Linux computer.

Prerequisites

Before you begin, complete the following tasks.

  1. Download and install a suitable 64-bit Python interpreter. Python 3.7 or higher is required. Make sure it is configured to work correctly with your system. (The steps in this task demonstrate building the Python interpreter using Python version 3.8.10.)
  2. Download TIBCO Spotfire® Statistics Services installation for your operating system from the TIBCO product site edelivery.tibco.com (license and account required). Spotfire® Statistics Services includes the Spotfire Service for Python.
    Note: You do not need to install Spotfire Statistics Services.
  3. In the Spotfire Statistics Services downloaded bundle, find the component Spotfire Service for Python.
  4. Extract the contents of the Spotfire Service for Python installation archive.

Procedure

  1. Install the 'spotfire' package into your Python interpreter.
    path/to/python/to/package/ python -m pip install spotfire
    Where path/to/python/to/package is the path to the Python interpreter to include in the package.
    Note: This also downloads and installs the other packages required by the Spotfire Service for Python.
  2. Run the following commands.
    export PYTHON_VERSION=<version.ver.ver>
    docker build --build-arg PYTHON_VERSION -t python-build-base:${PYTHON_VERSION} python-build-base
    Note: For PYTHON_VERSION=<version.ver.ver>, specify to three digits (for example, 3.8.10) the version of Python to use.
    The Python interpreter is created.
  3. Build the SPK using the following commands.
    spotfire-spk <python-build-base-tag> [arguments to spotfire.spk module]
    ./spotfire-spk <version.ver.ver> python python-interpreter.spk
    
    Note: For <version.ver.ver>, provide the version of Python specified in Step 2.
    • The file requirements.txt is created, specifying the Python packages required by Spotfire Service for Python for your Python interpreter to work with Spotfire.
    • The files python-interpreter.spk and python-packages.spk are created.

What to do next

Add the SPKs to the Spotfire Server Deployment area, and then validate and save the area. See Adding Software Packages to a Deployment Area and Updating Services in the TIBCO Spotfire® Server Installation and Administration guide for more information. The next time the Spotfire Analyst users connect to the Spotfire Server, they are prompted to update their installations with the new Python Interpreter and packages.