Code: Select all
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python Debugger: Attach using Process Id",
"type": "debugpy",
"request": "attach",
"processId": "${command:pickProcess}",
"justMyCode": false,
"env": {
"PYTHONHOME": "C:\\OSGeo4W\\apps\\Python312",
"PYTHONPATH": "C:\\OSGEO4W\\bin\\;C:\\OSGeo4W\\apps\\qgis-ltr\\python",
"PATH": "C:\\OSGeo4\\apps\\Python39\\Scripts;C:\\OSGeo4W\\apps\\qt5\\bin;C:\\OSGeo4W\\apps\\Python312\\Scripts;C:\\OSGeo4W\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\system32\\WBem;C:\\OSGeo4W\\apps\\qgis-ltr\\bin;C:\\OSGeo4\\apps\\Qt5\\bin;C:\\OSGeo4\\apps\\Python312\\Scripts",
"GDAL_DATA": "C:\\OSGEO4W\\share\\gdal",
"GDAL_DRIVER_PATH": "C:\\OSGEO4W\\bin\\gdalplugins",
"GDAL_FILENAME_IS_UTF8": "YES",
"GS_LIB": "C:\\OSGeo4W\\apps\\gs\\lib",
"GEOTIFF_CSV": "C:\\OSGEO4W\\share\\epsg_csv",
"O4W_QT_BINARIES": "C:\\OSGEO4W\\apps\\Qt5\\bin",
"O4W_QT_DOC": "C:\\OSGEO4W\\apps\\Qt5\\doc",
"O4W_QT_HEADERS": "C:\\OSGEO4W\\apps\\Qt5\\include",
"O4W_QT_LIBRARIES": "C:\\OSGEO4W\\apps\\Qt5\\lib",
"O4W_QT_PLUGINS": "C:\\OSGEO4W\\apps\\Qt5\\plugins",
"O4W_QT_PREFIX": "C:\\OSGEO4W\\apps\\Qt5",
"O4W_QT_TRANSLATIONS": "C:\\OSGEO4W\\apps\\Qt5\\translations",
"OSGEO4W_ROOT": "C:\\OSGeo4W",
"QT_PLUGIN_PATH": "C:\\OSGEO4W\\apps\\qgis\\qtplugins;C:\\OSGEO4W\\apps\\qt5\\plugins",
"QGIS_PREFIX_PATH": "C:\\OSGEO4W\\apps\\qgis",
},
}
]
}

.
Außerdem ist der Callstack-Bereich komplett leer:

Wenn ich in den Taskmanager schaue, sehe ich jedoch, dass ein Python-Prozess läuft. Wenn ich mir die Details ansehe, kann ich feststellen, dass der Speicherort C:\OSGeo4W\bin\python3.exe ist, wie durch die Variable PYTHONPATHin meiner launch.json-Datei angegeben.< /p>
Wenn ich erneut F5 drücke und erneut versuche, eine Verbindung zu QGIS herzustellen, informiert VS Code jedoch, dass bereits ein Debugger-Prozess angeschlossen ist:

Ich habe QGIS bereits vollständig deinstalliert und installierte es erneut (Version 3.34 LTS) über das OSGeo4W-Setup.
Nebenbei: Wenn ich meine Debug-Konsole in VS Code öffne, sehe ich diese Meldung:
Anhängen an PID fehlgeschlagen.
--- Anhängen an PID wird gestartet: 9988
--- Konnte nicht erfolgen plattformunabhängige Bibliotheken finden
was – soweit ich weiß – anzeigt, dass die PYTHONHOME-Variable leer ist.
Ich verwende VS Code 1.96.4 unter Windows 10