MaxCompute Studio allows you to develop Python projects, such as user-defined functions (UDFs) and PyODPS scripts, in IntelliJ IDEA. This topic shows how to configure the Python development environment.
Install PyODPS
- Install PyODPS, the Python SDK for MaxCompute, on your local machine. For installation instructions, see Install PyODPS.
- Start IntelliJ IDEA and choose from the top menu bar.
- In the left navigation pane of the Settings dialog box, click MaxCompute Studio.
- Set Python path to resolve UDF to your local Python installation path.
In the General Settings section, set the Python path to resolve UDF field to your local Python installation path. For example,
C:\Python27\python.exe.
Install the Python plugin
Search for and install the Python Community Edition plugin in the IntelliJ IDEA plugin marketplace.
- In the top menu bar of IntelliJ IDEA, choose File > Settings.
- In the left navigation pane of the Settings dialog box, click Plugins.
- In the search box, search for Python Community Edition and install it.
Configure Python dependencies
Configure the module's Python dependency to enable Python development in MaxCompute.
- On the top menu bar, choose .
- Add an SDK.
- In the left navigation pane, click SDKs.
- Click the
icon at the top, select Python SDK, choose System Interpreter, and then select your local Python interpreter.
After the SDK is added, the Name field is set toPython 2.7, and the Python SDK home path field is set toC:\Python27\python.exe. - Click Apply.
- Configure modules.
- In the left navigation pane, click Modules.
- Click + to add a Python facet to the module.
After you add the Python facet, it appears as a Python sub-item under your module. Select this sub-item and then choose the required interpreter from the Python Interpreter drop-down list. For example,
C:\Python27\python.exe. - Click Apply.