Python SDK Dependency Settings
Setting the Globally Dependent Python SDK
- In the project dialog box, choose . The Project Structure dialog box is displayed.
- On the left menu bar, choose Platform Settings > SDKs and add a Python library. For details, see Figure 1.
- (Optional) In the Add Python Interpreter window, select a proper Python interpreter. You can configure a Python interpreter or use the default one. Figure 2 shows the available interpreters.
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.)
- Ensure that corresponding Python libraries exist.
The following figure shows an example.
Figure 3 Viewing the Python libraries
- In the Project Structure window, click Apply.
- Click OK to close the Project Structure window.
Setting a Custom Globally Dependent Python SDK
During code development, if a third-party Python library or custom Python library is linked, perform the following steps to add the corresponding Python SDK to the project:
- In the project dialog box, choose . The Project Structure dialog box is displayed.
- On the left menu bar, choose .
- Select the corresponding Python library and click + in the Classpath column to add a custom Python library, as shown in Figure 4.
Notes:
- The Python libraries on the Platform Settings tab page are globally configured and take effect for all operator projects.
- Click OK to close the Project Structure window.
Set the Python SDK on which the current project depends.
During code development, if a third-party Python library or custom Python library is linked, perform the following steps to add the corresponding Python SDK to the project:
- In the project dialog box, choose . The Project Structure dialog box is displayed.
- On the left menu bar, choose .In Project SDK, select the Python SDK configured in Python SDK Dependency Settings from the drop-down list box and click Apply, as shown in Figure 5.
- Choose from the menu bar on the left.On the Dependencies tab page, select the Python SDK configured in Setting the Globally Dependent Python SDK from the drop-down list box and click Apply, as shown in Figure 6.
- Click OK to close the Project Structure window.A message is displayed on the menu bar at the bottom of the project, as shown in Figure 7.
- After the update is successful, the Python code can be automatically interpreted, as shown in Figure 8. Click the imported Python module code and press Ctrl+Q. The corresponding tips are displayed. You can press Ctrl and click to open the corresponding module definition file.
If the problem persists, close the project and open it again.







