Categories

Versions

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

安装Python脚本扩展

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

Installation for RapidMiner Studio

Prerequisites

To be able to run Python code within the RapidMiner 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 librarypandasversion 1.0 or later.

Installation

To install the extension, go to theExtensionsmenu, open theRapidMinerMarketplace (Updates and Extensions), and search forPython Scripting. For more detail, seeAdding extensions.

Configure: choose the default Python

Even without any configuration, the extension will attempt to detect a Python environment / executable. IfAnaconda是段d, it will by default use the environment namedbase. 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, readManage Python environments.

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

  1. Open thePreferencesdialog (on Mac OS go to theRapidMiner->Preferences...menu, on other systems use theSettings->Preferences...menu).

  2. Go to thePython Scriptingtab.

  3. If the folder containing your Python interpreter (or conda/virtualenvwrapper) is not in your system path, editSearch paths和包括它。

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

    • If you are usingAnaconda(orMiniconda), select theconda (anaconda)option from the drop-down list (this is the default). Theconda environmentparameter appears. From the drop-down list select the name of the environment you want to use. Click therefreshbutton, if you don't see your environment in the list.

    • If you are usingvirtualenvwrapper, select thevirtualenvwrapperoption from the drop-down list. Thevenvw environmentparameter appears. From the drop-down list select the name of the environment you want to use. Click therefreshbutton, if you don't see your environment in the list.

    • If you are using some other Python executable/distribution, select thespecific python binariesoption from the drop-down list. ThePython binary pathparameter appears. The extension scans some commonly used directories plus the additional directories you provided inSearch pathsfor Python executables; this scan may take some time. Select the desired Python executable from the drop-down menu. Click therefreshbutton 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 theopen filedialog.

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

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

    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. ClickOKto close the test result dialog. ClickOKone more time to close thePreferencesdialog and save the new settings.

Installation for RapidMiner AI Hub

Modern deployments of RapidMiner AI Hub ship with a working, configured Python Scripting Extension, and an Anaconda based Python environment which is centrally managed by 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 onmanaging environments.

Legacy AI Hub installations need manual steps to install the Python environment needed to run the code, as well as the extension itself. Follow theinstructions how to install and configure them on this page.