Creating an SPK for Python Packages on the node manager
An installation of Spotfire Service for Python on the node manager includes a Python interpreter and a set of packages to enable using Python in Spotfire.
The package named "spotfire" provides tools for building SPKs to share Python packages with other data function authors in an organization, or to enable Spotfire Business Author and Consumer users to see Python-enabled analyses in a web browser.
- If you are building an SPK for Linux only, then the SPK is deployed to the node manager. The packages it contains are used by data functions in analyses accessed through a web browser by Business Author and Consumer users.
- If you are building an SPK for Windows only, then the SPK can be deployed to the node manager, to other Spotfire Analyst users, or to both. Packages deployed to the node manager are used by data functions in analyses accessed through a web browser by Business Author and Consumer users. (Alternatively, you can build the SPK from an installation of Spotfire Analyst. For those details, see Creating an SPK for Python Packages from Spotfire Analyst on Windows.
The package builder relies on pip, the Python command-line application for Python package installation. The package builder uses a requirements.txt file to specify the packages to include in your SPK.
- To include a package from a different repository or in a local file path, in the
requirements.txt file, use the option
-i or
--index-url, followed by the location URL.
#example # mylib -i http://my.domain.org/lib/1.0.0/mylib/
- To include a
.whl package, in the
requirements.txt file, provide the relative path to the package from the current working directory.
#simple-example # ./my_path/my_package.whl packaging==1.0.0
For more information about creating a requirements.txt file for your package list, see its documentation at the following location.
- https://pip.readthedocs.io/en/stable/user_guide/#requirements-files
- https://pip.readthedocs.io/en/stable/reference/pip_install/#requirements-file-format
Perform this task from a command prompt on the Linux or Windows computer where the node manager includes the installation of Spotfire Service for Python.
Prerequisites
- You must have write access to the computer running the node manager where Spotfire Service for Python is installed.
- You must have created the file
requirements.txt containing the list of packages to include in your SPK.
The following example specifies these packages and specified versions from PyPI.
# ####### example-requirements.txt ####### # scipy == 1.3.3 matplotlib == 3.1.2 statsmodels == 0.10.2
- Linux servers only: You must first install the 'spotfire' package into the Python interpreter.