News

Latest Version of Debugpy Debugger in Python in Visual Studio Code Update

Version 1.0 of the new debugger for Python in Visual Studio Code (VS Code), called Debugpy, shows up in the latest update of the popular Python tooling for the open source, cross-platform code editor.

Microsoft updates its VS Code Python tooling regularly, and in March introduced the Debugpy debugger.

"We're excited to announce that in this release we're including a new debugger, Debugpy," said Luciana de Melo e Abud, program manager, Python extension in Visual Studio Code, in a March 19 blog post. "The debugger team has put a lot of effort into making it a faster and even more reliable Python debugger."

Python for VS Code comes with the Python extension in the editor's marketplace, which has been installed a whopping 26.6 million times, making it the most popular tool in the marketplace by far.

Debugpy supports live reload of web applications, such as Django and Flask apps, when debugging, Abud said. "This means that when you make edits to your application, you don't need to restart the debugger to get them applied: the web server is automatically reloaded in the same debugging session once the changes are saved," she said.

Debugpy offers a number of features that can help developers understand bugs, errors, and unexpected behaviors in their code, Abud explained. Devs can find an extensive list in the documentation. The post goes on to describe three ways of debugging:

  • Debug web apps: The tool supports live reload of web applications, Django and Flask apps, for examples. So when edits are made to an application, a restart of the debugger isn't required to apply them, because the web server is automatically reloaded in the same debugging session upon changes being saved. 
  • Debug local processes: Developers can choose to attach Debugpy to one of a list of local process that can be displayed. If a process ID is already known, it can be added directly to the "Attach using Process Id" configuration in the launch.json file.
  • Debug remotely: This can be done in two ways:
    • Remote Development Extensions -- "You can use Debugpy to debug your applications inside remote environments like Docker containers or remote machines (or even in WSL!) through the Remote Development extension. It allows VS Code to work seamlessly by running a light-weight server in the remote environment, while providing the same development experience as you get when developing locally."
    • Remote attach -- "You can also configure the debugger to attach to a Debugpy server running on a remote machine. All you need to provide is the host name and the port number the Debugpy server is listening to in the remote environment."

The post also lists a couple of notable changes:

  • Fix exporting from the interactive window. (#14210)
  • Do not opt users out of the insiders program if they have a stable version installed. (#14090)

 

About the Author

David Ramel is an editor and writer for Converge360.