You are viewing the RapidMiner Server documentation for version 9.7 -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.
If you are using acontainer based deployment, we will provide an Anaconda based Python environment, and the most recent version of the Python Scripting extension bundled with all your Job Agents. When using this deployment method, no further installation and configuration steps are neededfor regular process execution.
Check prerequisites
First, please ensure all prerequisites are met before continuing.
Please check that your machines running your RapidMiner Server (detailed below) have the following components installed:
When running processes asweb serviceson RapidMiner Server, ensure the above requirements are present on the machine running the RapidMiner Server component.
- 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.
- 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). - Locate all the settings beginning with
rapidminer.python_scripting
in the above file, and apply them to your Server deployment (see next step). - 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.
- 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):
- 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.
If you are using acontainer based deployment, a Python 3 based default environment will be preinstalled and configured on all Job Agents, and there is no need for any further configuration. Execute Python operators using the default settings should succeed out of the box during a Server execution.
Edit the
rapidminer.properties
file 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.properties
file should look something like this: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.