Creating a Virtual Environment for an Alternative Python Interpreter (Spotfire Analyst Computer)

If you want to create an SPK containing a different Python interpreter than the one distributed with Spotfire Service for Python, but you do not want to package it from within that Python interpreter, then you can create a virtual environment and create the SPK there.

Important: You must build a package for the operating system on which your Spotfire Server node manager is installed. This procedure creates a package for an alternative Python interpreter from a Windows computer.

This procedure describes creating a virtual environment to keep your installation of Python pristine, in the case where you either do not want to (or cannot) install the "spotfire" package into the Python interpreter. If you want to install the "spotfire" package into your alternative Python installation, see Creating a Spotfire Package for an Alternative Python Interpreter (for Windows).

Perform this task from the command prompt on the Windows computer where Spotfire is installed.

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. Create the new virtual environment.
    path/to/python/to/package/python -m venv %NEW_DIR%\venv
    Where path/to/python/to/package/ is the path to the version of Python to include in the package.
  2. Activate the virtual environment.
    %NEW_DIR%/venv/Scripts/activate.bat
    The command prompt changes to indicate that the virtual environment is active.
  3. Install the 'spotfire' package into the virtual environment.
    path/to/virtual/env/ python -m pip install spotfire
  4. To create the interpreter package, run the Python interpreter that you want to package.
    python -m spotfire.spk python [--analyst] name.spk
    The --analyst argument specifies that the package is to be distributed to Spotfire Analyst users.
  5. Deactivate the virtual environment.
    deactivate
    The command prompt reverts to the original prompt.

Result

The package containing the Python interpreter to distribute can be found in the file name.spk

What to do next

Place the SPK on the node manager for distribution to other Spotfire Analyst users.