Certain Python packages are filtered out automatically when creating a spk for Python packages.

Certain Python packages are filtered out automatically when creating a spk for Python packages.

book

Article ID: KB0070550

calendar_today

Updated On:

Products Versions
Spotfire Service for Python 1.12.0 and Higher

Description

Creating a Spotfire Package for Python Packages on the Node Manager specifies the process of building a Spotfire Package for Python Packages on the Node Manager: 

Example scenario :

The requirement.txt file contains the below
 
scipy == 1.8.1
statsmodels == 0.13.2
numpy == 1.26.2
pandas == 2.2.0

A spk containing the above packages is built and deployed to the server.

The following packages numpy(1.26.2) and pandas(2.2.0) are not included in the spk that is deployed on the server.
 

Issue/Introduction

This article talks about the scenario in which certain packages for example pandas, numpy with different versions are excluded/filtered out automatically when those are included in the process of building a spotfire package for Python packages (.spk).

Environment

All

Resolution

For testing:  On running a Data Function - Python script (Force Server) to print the version of pandas and numpy library, it does not show 1.26.2 and 2.2.6 but instead some other version numbers.

There are certain essential packages as mentioned in the document Included Packages. The packages listed in this table are required for Spotfire and the Python interpreter to work together. Removing or altering these packages may cause your Python data functions to fail.

If you are building an SPK intended for the Spotfire Service for Python, then you must avoid installing packages that are already included in the installation. Installing a different version of a package that is included in the service installation can cause unexpected errors. If a package you are installing depends on or requires one of the included packages, then it is filtered out when the SPK is built. For a list of included packages, see Included Packages.

The list above included numpy and pandas which are amongst the packages listed in the included packages, which are hence intentionally filtered out from the SPK.

These packages are intentionally filtered out during the SPK build process to ensure uninterrupted running of the Spotfire and the Python interpreter.

Additional Information

Doc: Creating a Spotfire Package for Python Packages on the Node Manager Doc: Included Packages