Creating a Spotfire Package for Python Packages from a Windows Computer
An installation of Spotfire Analyst includes a Python interpreter and a set of packages to enable using Python in Spotfire.
-m pip install spotfire
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. By default, the file requirements.txt searches the PyPI package site for the specified package and version.
- 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
If you are building an SPK intended for the Spotfire Service for Python, then avoid specifying packages that are included with the service installation. Installing a different version of one of these packages 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 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
This task creates an SPK for the Spotfire Service for Python, running on a node available to Spotfire Server. If you need to build a package to distribute to Spotfire Analyst users, see Python Data Functions in TIBCO Spotfire®.
Perform this task from a command prompt on the Windows computer where Spotfire Analyst is installed.
Procedure
Result
- The packages are added to the Spotfire Server node manager, where Business Author and Consumer users can access analyses that use the functions in the packages from their web browsers.
For an overview of the entire process, see Package Management for Spotfire Service for Python.