Preparations
In Windows, remote Python code redirection and association are supported.
Configuring the Python SDK Interpreter
To meet Python code debugging requirements during application development, a Python code debugging method based on the Python Community Edition plugin is provided. The debugging preparation is as follows. For details about how to configure the Python interpreter, see Python SDK Dependency Settings.
- Add the Python SDK.
- On the top menu bar, choose .
- In the left pane of the dialog box displayed, choose . Then, click + and select Add Python SDK in the displayed dialog box, as shown in Figure 1.
- In the Add Python Interpreter dialog box, select a proper Python interpreter and add it. Table 1 shows the available interpreters.
Figure 2 Adding a Python interpreter
Table 1 Python interpreter options Interpreter
Description
Virtualenv Environment
Integrates the Virtual Environment tool to create an independent virtual environment.
Conda Environment
Uses the Python interpreter contained in Anaconda.
System Interpreter
Specifies the local interpreter in the system.
Pipenv Environment
Pipenv is a tool that provides all the necessary means to create a virtual environment for Python projects.
Poetry Environment
Uses the Poetry tool to create a virtual environment based on project dependencies.
SSH Interpreter
Specifies a remote interpreter. You can add the Python SDK of a remote device in SSH mode and use the Deployment function to synchronize the files and folders in a specified project to a specified directory on the remote device. For details, see Deployment. (If you select this option, MindStudio remotely runs a project.)
- Configure the Python dependency for the project.
- On the top menu bar, choose .
- In the left pane of the dialog box displayed, choose and select the Python SDK to be added from the SDK drop-down list. Figure 3 shows a configuration example.
Debugging and Building the Configuration File
- On the top menu bar, choose or click the run configuration box on the toolbar to access the run configuration page.
- Click + in the upper left corner, select , and add the run and debug configurations of the file.
- The configuration options are displayed on the right. Table 2 describes the key configuration parameters. Figure 5 shows a configuration example.Click Apply, and then click OK to save the settings and close the debug configuration page.
Table 2 Debug and run parameters Parameter
Description
Name
This parameter is user-defined.
Script path
Select the path of the Python source file to be debugged.
Python interpreter
Use SDK of module: interpreter specified by the project. For details, see Configuring the Python SDK Interpreter.
Use specified interpreter: local/remote interpreter. You can switch between local and remote interpreters.
Working directory
Working directory (defaults to the directory where the Python source file to be debugged is located).



