Categories

Versions

You are viewing the RapidMiner Python documentation for version 2024.0 - Check here for latest version

Install the Python Scripting Extension

On this page, you will learn how to install the Python Scripting Extension and how to configure its dependencies on Altair AI Studio and Altair AI Hub. As a result, you will be able to execute Python code as part of your processes.

Installation for Altair AI Studio

Prerequisites

To be able to run Python code within the operators provided by the Python Scripting Extension, you will need a working Python environment. We recommend the best practice of using a package manager which supports multiple environments for the sake of isolating package dependencies to ensure reproducible execution. The extension supports Anaconda and virtualenvwrapper as package managers.

In order for the Python Scripting Extension to execute code successfully, the Python environment in use needs to contain the library pandas version 1.0 or later.

Installation

To install the extension, go to the Extensions menu, open the Download Marketplace (Updates and Extensions), and search for Python Scripting. For more detail, see Adding extensions.

Configure: choose the default Python

Even without any configuration, the extension will attempt to detect a Python environment / executable. If Anaconda is installed, it will by default use the environment named base. As a fallback, it will use the first Python executable it finds on the available search paths.

Before using the extension for the first time, you should configure its default settings: the location of your Python interpreter or the name of your virtual environment. If you have multiple Python environments, read Manage Python environments.

To configure the extension with the default Python, take the following steps:

  1. Open the Preferences dialog (on Mac OS go to the Altair AI Studio -> Preferences... menu, on other systems use the Settings -> Preferences... menu).

  2. Go to the Python Scripting tab.

    img/preferences-1.png

  3. If the folder containing your Python interpreter (or conda/virtualenvwrapper) is not in your system path, edit Search paths and include it.

  4. Based on your needs, set the package manager to one of the following:

    • If you are using Anaconda (or Miniconda), select the conda (anaconda) option from the drop-down list (this is the default). The conda environment parameter appears. From the drop-down list select the name of the environment you want to use. Click the refresh button, if you don't see your environment in the list.

    • If you are using virtualenvwrapper, select the virtualenvwrapper option from the drop-down list. The venvw environment parameter appears. From the drop-down list select the name of the environment you want to use. Click the refresh button, if you don't see your environment in the list.

    • If you are using some other Python executable/distribution, select the specific python binaries option from the drop-down list. The Python binary path parameter appears. The extension scans some commonly used directories plus the additional directories you provided in Search paths for Python executables; this scan may take some time. Select the desired Python executable from the drop-down menu. Click the refresh button if you don't see it in the list. Alternatively, locate your executable and provide the full path by typing it into the text box or by selecting it from the open file dialog.

    When you click the refresh button, it may take a few seconds until the drop-down list is updated.

  5. Once you have selected the desired environment/executable, click the Test button. If your configuration is successful, you may see something like this:

    img/preferences-2.png

    If testing fails, try to select a different environment/executable or address the problems shown in the dialog. Most probably you will need to install or upgrade some Python packages in your environment/executable.

  6. Click OK to close the test result dialog. Click OK one more time to close the Preferences dialog and save the new settings.

Installation for Altair AI Hub

Modern deployments of Altair AI Hub ship with a working, configured Python Scripting Extension, and an Anaconda based Python environment which is centrally managed by the Altair RapidMiner Platform Admin. This Python environment comes with the most commonly used libraries in data science tasks. To configure and use other environments, follow the instructions on managing environments.