Skip to content

Commit 3c43ac4

Browse files
committed
Experimental debugger section
1 parent 8f50efa commit 3c43ac4

4 files changed

+43
-3
lines changed

docs/python/debugging-python-in-visual-studio.md

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Debugging Python code
33
description: A walkthrough of the debugging features in Visual Studio specifically for Python code, including setting breakpoints, stepping, inspecting values, looking at exceptions, and debugging in the interactive window.
4-
ms.date: 06/26/2018
4+
ms.date: 07/13/2018
55
ms.prod: visual-studio-dev15
66
ms.technology: vs-python
77
ms.topic: conceptual
@@ -13,7 +13,7 @@ ms.workload:
1313
- data-science
1414
---
1515

16-
# Debugging your Python code
16+
# Debug your Python code
1717

1818
Visual Studio provides a comprehensive debugging experience for Python, including attaching to running processes, evaluating expressions in the Watch and Immediate windows, inspecting local variables, breakpoints, step in/out/over statements, Set Next Statement, and more.
1919

@@ -189,6 +189,46 @@ The Debug Interactive window has its own set of options, which you can access th
189189

190190
![Debug Interactive Window Options](media/debugging-interactive-options.png)
191191

192+
## Use the experimental debugger
193+
194+
Starting with Visual Studio 2017 Preview 4.0, you can opt into using the "experimental debugger", which is based on ptvsd version 4.1+. To opt in, select the **Tools** > **Options** menu command, then navigate to **Python** > **Experimental** in the Options dialog box and select **Use experimental debugger.**
195+
196+
The experimental debugger is compatible with only limited Python environments, as described in the following table:
197+
198+
| Python version | Compatible with the experimental debugger |
199+
| --- | --- |
200+
| 2.6 | No |
201+
| 2.7 | Yes |
202+
| 3.1 | No |
203+
| 3.2 | No |
204+
| 3.3 and later | Yes |
205+
| IronPython | No |
206+
207+
If you attempt to use the experimental debugger with an incompatible environment, Visual Studio shows the error, "Debugger is incompatible with this environment":
208+
209+
![Debugger is incompatible with this environment error when using the experimental debugger](media/debugging-experimental-incompatible-error.png)
210+
211+
Select the **Disable the experimental debugger** command, which clears the **Use experimental debugger** option.
212+
213+
If you've installed an older version of ptvsd in the current environment (such as an earlier 4.0.x version of a 3.x version required for remote debugging), Visual Studio shows either the error "Debugger package could not be loaded," or the warning, "Debugger package is outdated":
214+
215+
![Debugger package could not be loaded error when using the experimental debugger](media/debugging-experimental-version-error.png)
216+
217+
![Debugger package is outdated warning when using the experimental debugger](media/debugging-experimental-version-warning.png)
218+
219+
Although you may choose to ignore the warning, Visual Studio may not work correctly. If you see the error, you must update ptvsd to its latest version, or uninstall the package to allow Visual Studio to use its bundled (and well tested) version.
220+
221+
You can manage ptvsd in the *Packages** tab in the **Python Environments** window, or through the command line with the following commands.
222+
223+
```ps
224+
# Uninstalling ptvsd causes VS to default to its bundled 4.1.x version.
225+
pip uninstall ptvsd
226+
227+
# Upgrading ptvsd gives you the latest version, which may be newer than the bundled version.
228+
# -pre is required to allow pre-release versions as currently required by the experimental debugger.
229+
pip install --upgrade ptvsd -pre
230+
```
231+
192232
## See also
193233

194-
For complete details on the Visual Studio debugger, see [Debugging in Visual Studio](../debugger/debugger-feature-tour.md).
234+
For complete details on the Visual Studio debugger, see [Debugging in Visual Studio](../debugger/debugger-feature-tour.md).
Loading
Loading
Loading

0 commit comments

Comments
 (0)