How to Use Python Tools


Python is an interpreted, high-level, general-purpose programming language. A Python interpreter is provided in your installation of Spotfire so you can script and run data functions to create predictive models. Python Tools are provided to give you access to the Python interpreter to test scripts. Python Tools also provides an interface to download and install packages from the PyPI package repository.  

Note: The Python Tools option is an extension to Spotfire, so you must have the extension license to use Python Tools. See your administrator for more information.

To find the Python interpreter:

  1. On the menu bar, click Tools > Python Tools.

    Response: The Python Tools dialog is displayed.

    Comment: The path to the interpreter is displayed in the Path to Local Python Interpreter text box, but it is unchangeable.

  2. In the Engine tab, click Copy Python Interpreter Path to Clipboard.

    Comment: The default path is to the Python interpreter provided with Spotfire. If you have provided a path to a different Python interpreter in Tools > Options, that path is displayed.

To open the Python interpreter:

  1. On the menu bar, click Tools > Python Tools.

    Response: The Python Tools dialog is displayed.

  2. Click Launch Python Interpreter.
    Response: The Python interpreter is launched in a separate window.

To find and install a package from PyPI:

  1. On the menu bar, click Tools > Python Tools.
    Response: The Python Tools dialog is displayed.

  2. Click the Package Management tab.

  3. In the Available Packages text box, type the name of the package to find.
    Response: The Available Packages list displays all packages that use the package name in their summaries.

  4. From the list, select the package name, and then click Install.
    Result: The package and all of its dependent packages are installed, and the Installed Packages list is updated to reflect the new installation.

To remove an installed package

  1. On the menu bar, click Tools > Python Tools.

    Response: The Python Tools dialog is displayed.

  2. Click the Package Management tab.

  3. From the Installed Packages list, select one or more packages to remove, and then click Remove.

    Response: The package is removed from your computer and the list is updated.
    Important: Packages with a preceding asterisk are provided by default and are required for the Python interpreter to work with Spotfire. You cannot remove these packages.

To upgrade an installed package

  1. On the menu bar, click Tools > Python Tools.

    Response: The Python Tools dialog is displayed.

  2. Click the Package Management tab.

  3. From the Installed Packages list, select a package that indicates it has an upgraded version, and then click Upgrade.

    Response: The package is updated to a newer version.

Note: If you want to install a custom package, or install a package located in a different repository, see Python Data Functions in TIBCO Spotfire, available at https://docs.tibco.com/products/tibco-spotfire-analyst.

Spotfire packages (SPKs) differ from Python packages. The SPK is the means to deploy extensions to the Spotfire Server, which then distributes its contents to Spotfire Analyst users.

See also:

Python Tools - Details on Engine

Python Tools - Details on Package Management