Categories

Versions

You are viewing the RapidMiner Server documentation for version 9.4 -Check here for latest version

Install and configure the Python Scripting extension

How to read this page

This page will guide you through installing and setting up the Python Scripting extension in your RapidMiner Server deployment.

First, please ensure thatprerequisitesare fulfilled, then安装的扩展.

If you want to execute Python code inside a process used inweb servicedeployment,follow these steps.

If you want to execute Python code as part of aregular process execution,follow these steps.

Check prerequisites

First, please ensure all prerequisites are met before continuing.

  1. Please check that your machines running your RapidMiner Server (detailed below) have the following components installed:

    • aPythoninterpreter (we recommend using theAnacondadistribution)
    • the Python packagepandas
    • the Python environments should be identical (if possible) throughout the RapidMiner Server deployment (the Server instance and all connected Job Agents)
  2. When running processes asweb serviceson RapidMiner Server, ensure the above requirements are present on the machine running the RapidMiner Server component.

  3. When running processes regularly, in the scalableJob Agentarchitecture, ensure the above requirements are present on ALL machines where Job Agents are running for your RapidMiner Server deployment.

Install the extension

Make sure that the same version of the extension is installed on RapidMiner Server as on all theRapidMiner Studio instancesyou are using to create RapidMiner Server process(es).

Follow the instructions on theExtensionspage to locate thePython Scripting extension on the Marketplace, and download it to the designated location on your RapidMiner Server machine.

Configure the extension for web service execution

Please follow these instructions if you would like to run processesas web serviceson RapidMiner Serverthat contain Execute Python operators.

  1. If you have a RapidMiner Studio with the Python Scripting extension installed, locate the Studio configuration file (namedrapidminer-studio-settings.cfg) in the home folder (usually a~/.RapidMinerfolder inside your home directory, e.g.C:\Users\your username\.RapidMiner\on Windows).
  2. Locate all the settings beginning withrapidminer.python_scriptingin the above file, and apply them to your Server deployment (see next step).
  3. On the web interface or your RapidMiner Server deployment, openAdministration > System Settingsand add therelevant Python Scripting settingsto define your Python interpreter. You will likely need to modify some settings (like file paths), if your Studio and Server are located on different machines.
  4. ClickSubmitafter you have added all settings. For example, your System Settings tab may look like this (note that you may not need to define all parameters shown here):
  5. Restart RapidMiner Server for these changes to take effect.

Depending on your Python installation, you may add one or more of the following settings:

If you plan to use the Keras Extension, you should also add these (legacy) settings:

Configure the extension for regular process execution

Please follow the instructions below if you would like torun processes regularlyon RapidMiner Serverthat contain Execute Python operators.

You will need to apply the settings detailed in this chapter toallJob Agents in your Server deployment.

  1. Edit therapidminer.propertiesfile inside the{job-agent-home}/config/rapidminer/directory, where{job-agent-home}意味着工作的主文件夹代理(通常瞧cated in the home of your Server installation). If the file doesn't exist, create it. For more information, visit thedocumentation for job agents. Add thesame properties as detailed in theprevious chapter. Therapidminer.propertiesfile should look something like this:

  2. Restart RapidMiner Server. The Python Scripting extension is now configured and ready to use.

Final notes

If thePython Scriptingextension is installed on a connected RapidMiner Studio instance, you can now create processes with theExecute Python operatorand run them on your Server deployment.

You can now also read and write resources or run processes on the server calling from Python code. For more info, visit thedevelopers documentation.

Keep in mind that theExecute Pythonoperators may override the Python interpreter settings defined in the previous chapters on a per operator basis. Thus if you want to run processes on RapidMiner Server that were created in RapidMiner Studio, you may need to modify some operator parameters.

Example: you want to use a custom conda environment in your Execute Python operator. To do this, you uncheck “use default python” and set the environment in your Studio process. When running this process on Server, you need to make sure that this custom environment exists on all Job Agents in your Server deployment.