Categories

Versions

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

Install the Python Scripting extension on legacy RapidMiner Server

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 that prerequisites are fulfilled, then install the extension.

If you want to execute Python code inside a process used in web service deployment, follow these steps.

If you want to execute Python code as part of a regular 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:

    • a Python interpreter (we recommend using the Anaconda distribution)
    • the Python package pandas
    • 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 as web services on RapidMiner Server, ensure the above requirements are present on the machine running the RapidMiner Server component.

  3. When running processes regularly, in the scalable Job Agent architecture, 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 the RapidMiner Studio instances you are using to create RapidMiner Server process(es).

Follow the instructions on the Extensions page to locate the Python 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 processes as web services on RapidMiner Server that contain Execute Python operators.

  1. If you have a RapidMiner Studio with the Python Scripting extension installed, locate the Studio configuration file (named rapidminer-studio-settings.cfg) in the home folder (usually a ~/.RapidMiner folder inside your home directory, e.g. C:\Users\your username\.RapidMiner\ on Windows).
  2. Locate all the settings beginning with rapidminer.python_scripting in the above file, and apply them to your Server deployment (see next step).
  3. On the web interface or your RapidMiner Server deployment, open Administration > System Settings and add the relevant Python Scripting settings to 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. Click Submit after 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 to run processes regularly on RapidMiner Server that contain Execute Python operators.

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

  1. Edit the rapidminer.properties file inside the {job-agent-home}/config/rapidminer/ directory, where {job-agent-home} means the home folder of the job agent (usually located in the home of your Server installation). If the file doesn't exist, create it. For more information, visit the documentation for job agents. Add the same properties as detailed in the previous chapter. The rapidminer.properties file should look something like this:

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

Final notes

If the Python Scripting extension is installed on a connected RapidMiner Studio instance, you can now create processes with the Execute Python operator and 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, read Call RapidMiner from Python.

Keep in mind that the Execute Python operators 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.