# Build a suitable Python interpreter for Spotfire Service for Python (for Linux)

The installation of the Spotfire Service for Python on your Spotfire Server includes a Python interpreter and a set of packages to enable using Python. The installed Spotfire client also includes the same version of a Python interpreter. You can provide a different version of the Python interpreter, if needed, on both the Spotfire Server and the installed Spotfire client.

Most OS-provided Python interpreters on Linux are not well-suited to use with the Spotfire Service for Python. If you want to use another Python interpreter on your Spotfire Server node manager on Linux, then for best compatibility and results, build your Python interpreter from source using a Docker image that closely reflects the runtime environment of the Spotfire Service for Python.

Note: debian:12-slim is our preferred Linux distribution for use with the Spotfire Service for Python.

This version of the Spotfire Service for Python includes dockerfiles that you can use to build a fully-compatible Python interpreter, or you can build an SPK for packages to use with the Spotfire Service for Python. You can build the Python interpreter from either Windows or Linux.

Important: When you build the SPK containing a different Python interpreter, include the `--constraints` option to use the packages specified in the file interpreter-constraints.txt, which is included with your distribution of the Spotfire Service for Python. Provide the complete path to the file. For example:

    --constraints /opt/files/interpreter-constraint.txt

If you omit this option, the required packages might be updated to versions newer than the ones included with the Spotfire Service for Python. The included package versions are tested with Spotfire. While typically Python package authors take care for backwards compatibility, it is possible that a change to one of these packages could result in your data functions failing to work correctly. Spotfire Support can help you if you encounter such a breaking issue.

Table 1. Tools to build the Python interpreter and packages SPKs
Tool | Description
--- | ---
python-build-base | Contains a full Python build environment including all necessary dependencies.
python-base | Contains all runtime libraries required to support Python packages.
spotfire-spk | Used to call the python-build-base container to build the SPK containing the Python interpreter, and to build the SPK containing the required packages for the Spotfire Service for Python.