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

You can build a Python interpreter from source using a Docker image on Windows, and then place the Python interpreter in a Spotfire package to deploy on a Spotfire Server running on Linux.

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

Prerequisites

Before you begin, complete the following two tasks.

  • Download and install a suitable 64-bit Python interpreter. Python 3.5 or higher is required.
    Note: The steps in this task demonstrate building the Python interpreter using Python version 3.7.5
  • Download TIBCO Spotfire® Statistics Services installation from the TIBCO product site edelivery.tibco.com (license and account required). Spotfire® Statistics Services includes the Spotfire Service for Python.

Procedure

  1. Extract the contents of the Spotfire Service for Python installation archive.
  2. Browse to the python directory.
  3. Copy the Spotfire package wheel file (spotfire-<version>-py2.py3-none-any.whl) and place the copy in the python/dockerfiles/python-build-base directory.
  4. Call the following commands.
    set PYTHON_VERSION=<version.ver.ver>
    set SPOTFIRE_WHEEL_VERSION=1.0.1
    docker build --build-arg PYTHON_VERSION --build-arg SPOTFIRE_WHEEL_VERSION -t python-build-base:%PYTHON_VERSION% python-build-base
    Note: For PYTHON_VERSION=<version.ver.ver>, specify to three digits (for example, 3.7.5) the version of Python to use.
    The Python interpreter is created.
  5. Build the SPK.
    spotfire-spk <python-build-base-tag> [arguments to spotfire.spk module]
    spotfire-spk 3.7.5 python python-interpreter.spk
    
    Note: For <version.ver.ver>, provide the version of Python specified in Step 4.
    • 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.