Select to view content in your preferred language

Debug ArcGIS Pro python tools in VS Code using Attach to Process functionality

5048
15
10-12-2022 01:26 PM
Status: Implemented
I_AM_ERROR
Regular Contributor

It would be great to have Microsoft VS Code supported as a debugging environment for ArcGIS Pro. Python scripts and tools are currently a bit cumbersome to debug, especially if there is a need to inspect variables that run through UpdateParameters or UpdateMessages.

Ideally, we could use to VS Code to:

- Debug using Attach to Process

- Set break points in code

- Execute tools in ArcGIS Pro

- Executing is paused at breakpoints to debug/inspect variables/ step over, etc.

I see that Visual Studio is supported per documentation here, please consider officially supporting debugging in VS Code as it's quite popular in the python community.

15 Comments
BrandoCrozier

Thanks for looking into this @LanceKirby2 

BrandoCrozier

At the create gp tools presentation they just mentioned that it probably won't come out until 3.5.

LanceKirby2

@BrandoCrozier they said the same thing python expo station. 

JoelBurley

I was excited when I heard about this today at the Dev summit.  Heard it will be a beta in Pro 3.5.

HannesZiegler
Status changed to: Implemented

The ArcGIS Pro Debugger Extension for Visual Studio Code is now available on the Visual Studio Code Marketplace!

ArcGIS Pro Debugger - Visual Studio Marketplace

This extension allows debugging ArcGIS Pro script tools (.atbx, .pyt) using Visual Studio Code (VSC).

Our aim is to provide developers a seamless workflow to attach VSC to the Python process live in ArcGIS Pro. This integration allows developers to leverage VSC's native Python debugging experience while developing script tools for ArcGIS Pro.

 

  • Easily attach to ArcGIS Pro and stand-alone Python processes
  • Debug ArcGIS Pro Script Tools (.atbx) and Python Toolboxes (.pyt)
  • Debug code on the local machine or remotely on a different machine


If you run into any issues, please log an issue in our public repository, 

Esri/arcgispro-vscode-debugger


Additional resources:
Debug Python code—ArcGIS Pro | Documentation