You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/python/debugging-python-in-visual-studio.md
+46-3Lines changed: 46 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Debugging Python code
3
3
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
5
5
ms.prod: visual-studio-dev15
6
6
ms.technology: vs-python
7
7
ms.topic: conceptual
@@ -13,7 +13,7 @@ ms.workload:
13
13
- data-science
14
14
---
15
15
16
-
# Debugging your Python code
16
+
# Debug your Python code
17
17
18
18
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.
19
19
@@ -189,6 +189,49 @@ The Debug Interactive window has its own set of options, which you can access th
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
+

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
+

218
+
219
+

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
+
192
235
## See also
193
236
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).
0 commit comments