Creating an SPK for Python Packages from Spotfire Analyst on Windows
An installation of Spotfire Analyst includes a Python interpreter and a set of packages to enable using Python in Spotfire.
One of these packages, spotfire.zip, 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. For more information about package workflow, see Package management for Spotfire Service for Python.
Spotfire Analyst relies on pip, the Python command-line application for Python package installation. Spotfire Analyst 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
Python users perform this task from a command prompt on the Windows computer where Spotfire Analyst is installed.
Prerequisites
- You must have the appropriate Spotfire license for authoring data functions.
- 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