Skip to content

Commit 87c2d27

Browse files
authored
Merge pull request #2499 from kraigb/kraigb-feedback
Experimental debugger section
2 parents f801cc4 + 187095e commit 87c2d27

4 files changed

+46
-3
lines changed

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

Lines changed: 46 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,49 @@ 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 to 3.4 | No |
203+
| 3.5 and later | Yes |
204+
| IronPython | No |
205+
206+
If you attempt to use the experimental debugger with an incompatible environment, Visual Studio shows the error, "Debugger is incompatible with this environment":
207+
208+
![Debugger is incompatible with this environment error when using the experimental debugger](media/debugging-experimental-incompatible-error.png)
209+
210+
Select the **Disable the experimental debugger** command, which clears the **Use experimental debugger** option.
211+
212+
> [!Note]
213+
> The warning is not presently shown for Python 3.3 and 3.4.
214+
215+
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":
216+
217+
![Debugger package could not be loaded error when using the experimental debugger](media/debugging-experimental-version-error.png)
218+
219+
![Debugger package is outdated warning when using the experimental debugger](media/debugging-experimental-version-warning.png)
220+
221+
To manage your ptvsd installation, use the **Packages** tab in the **Python Environments** window, or use the following commands from the command line:
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+
232+
> [!Important]
233+
> Although you may choose to ignore the warning for some versions of ptvsd, Visual Studio may not work correctly.
234+
192235
## See also
193236

194-
For complete details on the Visual Studio debugger, see [Debugging in Visual Studio](../debugger/debugger-feature-tour.md).
237+
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)