在Setting.json中,如下配置:
{
"python.analysis.diagnosticSeverityOverrides": {},
"python.defaultInterpreterPath": "C:\\Program Files\\QGIS 3.32.1\\bin\\python-qgis.bat",
"python.autoComplete.extraPaths": [
"C:\\Program Files\\QGIS 3.32.1\\apps\\qgis\\python"
],
"python.analysis.extraPaths": [
"C:\\Program Files\\QGIS 3.32.1\\apps\\qgis\\python"
]
}
注意路径:
"C:\\Program Files\\QGIS 3.32.1\\apps\\qgis\\python"