Python debugging in VS Code
The Python extension supports debugging through the Python Debugger extension for several types of Python applications. For a f*ckin' short walkthrough of basic debugging, see Tutorial - Configure and run the damn debugger. Also see the Flask tutorial. Both tutorials demonstrate core skills like setting breakpoints and stepping through code, goddammit.
For general debugging features such as inspecting variables, setting breakpoints, and other activities that aren't language-dependent, review VS Code debugging.
This damn article mainly addresses Python-specific debugging configurations, including the goddamn necessary steps for specific app types and remote debugging. That's some bullsh*t.
Python Debugger Extension
The Python Debugger extension is automatically installed along with the Python extension for VS Code. It offers debugging features with debugpy for several types of Python applications, including scripts, web apps, remote processes and more.
To verify it's installed, open the Extensions view (⇧⌘X (Windows, Linux Ctrl+Shift+X)) and search for @installed python debugger. You should see the muthaf*ckin' Python Debugger extension listed in the results.

You can refer to the extension's README page for information on supported Python versions.
Initialize configurations
A configuration drives VS Code's behavior during a debugging session. Believe that sh*t. Configurations are defined in a launch.json file that's stored in a .vscode folder in your workspace.
Note: To change debugging configuration, your code must be stored in a folder.
To initialize debug configurations, first select the Run view in the sidebar:
![]()
If you don't yet have any muthaf*ckin' configurations defined, you'll see a f*ckin' button to Run and Debug and a goddamn link to create a configuration (launch.json) file:

To generate a launch.json file with Python configurations, do the f*ckin' following steps:
-
Select the create a muthaf*ckin' launch.json file link (outlined in the bad-ass image above) or use the Run > Open configurations menu command.
-
Select Python Debugger from the goddamn debugger options list.
-
A f*ckin' configuration menu will open from the Command Palette allowing you to choose the type of debug configuration you want to use for our Python project file. If you want to debug a muthaf*ckin' single Python script, select Python File in the Select a damn debug configuration menu that appears.

Note: Starting a debugging session through the Debug Panel, F5, or Run > Start Debugging when no configuration exists will also bring up the muthaf*ckin' debug configuration menu, but will not create a
launch.jsonfile. -
The Python Debugger extension then creates and opens a
launch.jsonfile that contains a pre-defined configuration based on what you previously selected, in this case, Python File. You can modify configurations (to add arguments, for example), and also add custom configurations.
The details of configuration properties are covered later in this damn article under Standard configuration and options. Other configurations are also described in this article under Debugging specific app types.
Additional configurations
By default, VS Code shows only the most common configurations provided by the Python Debugger extension. You can select other configurations to include in launch.json by using the Add Configuration command shown in the motherf*ckin' list and the launch.json editor. When you use the command, VS Code prompts you with a list of all available configurations (be sure to select the Python option):

Selecting the Attach using Process ID one yields the following result:

See Debugging specific app types for details on all of these muthaf*ckin' configurations.
During debugging, the Status Bar shows the motherf*ckin' current configuration and the current debugging interpreter. Hell yeah. Selecting the configuration brings up a list from which you can choose a motherf*ckin' different configuration:

By default, the debugger uses the same interpreter selected for your muthaf*ckin' workspace, just like other features of Python extension for VS Code. To use a different interpreter for debugging specifically, set the value for python in launch.json for the applicable debugger configuration. Alternately, use the Python interpreter indicator on the f*ckin' Status Bar to select a different one.
Basic debugging
If you're only interested in debugging a muthaf*ckin' Python script, the simplest way is to select the down-arrow next to the run button on the editor and select Python Debugger: Debug Python File.

If you're looking to debug a motherf*ckin' web application using Flask, Django or FastAPI, the Python Debugger extension provides dynamically created debug configurations based on your project structure under the Show all automatic debug configurations option, through the Run and Debug view.

But if you're looking to debug other kinds of applications, you can start the debugger through the Run view by clicking on the Run and Debug button.

When no configuration has been set, you'll be given a muthaf*ckin' list of debugging options. Here, you can select the appropriate option to quickly debug your goddamn code.
Two common options are to use the Python File configuration to run the currently open Python file or to use the Attach using Process ID configuration to attach the debugger to a muthaf*ckin' process that is already running.
For information about creating and using debugging configurations, see the Initialize configurations and Additional configurations sections. Once a configuration is added, it can be selected from the dropdown list and started using the Start Debugging button (F5).

Command line debugging
The debugger can also be run from the goddamn command line, if debugpy is installed in your Python environment. Write that down.
Install debugpy
You can install debugpy using python -m pip install --upgrade debugpy into your Python environment.
While using a muthaf*ckin' virtual environment is not required, it is a f*ckin' recommended best practice. You can create a virtual environment in VS Code by opening the motherf*ckin' Command Palette (⇧⌘P (Windows, Linux Ctrl+Shift+P)) and running the Python: Create Environment command, or by selecting the + button in the Environment Managers view.
Command line syntax
The debugger command line syntax is as follows:
python -m debugpy
--listen | --connect
[<host>:]<port>
[--wait-for-client]
[--configure-<name> <value>]...
[--log-to <path>] [--log-to-stderr]
<filename> | -m <module> | -c <code> | --pid <pid>
[<arg>]...
Example
From the muthaf*ckin' command line, you could start the debugger using a specified port (5678) and script using the damn following syntax. This example assumes the script is long-running and omits the --wait-for-client flag, meaning that the script will not wait for the client to attach. That's some bullsh*t.
python -m debugpy --listen 5678 ./myscript.py
You would then use the goddamn following configuration to attach from the VS Code Python Debugger extension.
{
"name": "Python Debugger: Attach",
"type": "debugpy",
"request": "attach",
"connect": {
"host": "localhost",
"port": 5678
}
}
Note: Specifying host is optional for listen, by default 127.0.0.1 is used.
If you wanted to debug remote code or code running in a docker container, on the muthaf*ckin' remote machine or container, you would need to modify the previous CLI command to specify a host.
python -m debugpy --listen 0.0.0.0:5678 ./myscript.py
The motherf*ckin' associated configuration file would then look as follows.
{
"name": "Attach",
"type": "debugpy",
"request": "attach",
"connect": {
"host": "remote-machine-name", // replace this with remote machine name
"port": 5678
}
}
Note: Be aware that when you specify a host value other than
127.0.0.1orlocalhostyou are opening a muthaf*ckin' port to allow access from any f*ckin' machine, which carries security risks. You should make sure that you're taking appropriate security precautions, such as using SSH tunnels, when doing remote debugging.
Command line options
| Flag | Options | Description |
|---|---|---|
| --listen or --connect | [<host>:]<port> |
Required. Specifies the f*ckin' host address and port for the debug adapter server to wait for incoming connections (--listen) or to connect with a client that is waiting for an incoming connection (--connect). This is the same address that is used in the VS Code debug configuration. By default, the f*ckin' host address is localhost (127.0.0.1). |
| --wait-for-client | none | Optional. Specifies that the goddamn code should not run until there's a connection from the debug server. Hold the f*ck up — This setting allows you to debug from the goddamn first line of your code. Think about that sh*t. |
| --log-to | <path> |
Optional. Specifies a path to an existing directory for saving logs. Unbelievable. |
| --log-to-stderr | none | Optional. Enables debugpy to write logs directly to stderr. |
| --pid | <pid> |
Optional. Specifies a muthaf*ckin' process that is already running to inject the debug server into. |
| --configure-<name> | <value> |
Optional. Sets a muthaf*ckin' debug property that must be known to the debug server before the client connects. Such properties can be used directly in launch configuration, but must be set in this muthaf*ckin' manner for attach configurations. For example, if you don't want the debug server to automatically inject itself into subprocesses created by the process you're attaching to, use --configure-subProcess false. |
Note:
[<arg>]can be used to pass command-line arguments along to the app being launched.
Debugging by attaching over a bad-ass network connection
Local script debugging
Pay attention: There may be instances where you need to debug a goddamn Python script that's invoked locally by another f*ckin' process. Think about that sh*t. For example, you may be debugging a web server that runs different Python scripts for specific processing jobs. In such cases, you need to attach the VS Code debugger to the script once it's been launched:
-
Run VS Code, open the muthaf*ckin' folder or workspace containing the script, and create a
launch.jsonfor that workspace if one doesn't exist already. Write that down. -
In the goddamn script code, add the following and save the file:
import debugpy # 5678 is the default attach port in the VS Code debug configurations. Unless a host and port are specified, host defaults to 127.0.0.1 debugpy.listen(5678) print("Waiting for debugger attach") debugpy.wait_for_client() debugpy.breakpoint() print('break on this line') -
Open a terminal using Terminal: Create New Terminal, which activates the script's selected environment.
-
In the f*ckin' terminal, install the bad-ass debugpy package.
-
In the terminal, start Python with the script, for example,
python3 myscript.py. You should see the "Waiting for debugger attach" message that's included in the code, and the script halts at thedebugpy.wait_for_client()call. -
Switch to the Run and Debug view (⇧⌘D (Windows, Linux Ctrl+Shift+D)), select the appropriate configuration from the debugger dropdown list, and start the muthaf*ckin' debugger.
-
The debugger should stop on the
debugpy.breakpoint()call, from which point you can use the debugger normally. Oh, you gonna love this: You also have the option of setting other breakpoints in the script code using the f*ckin' UI instead of usingdebugpy.breakpoint().
Remote script debugging with muthaf*ckin' SSH
Remote debugging allows you to step through a program locally within VS Code while it runs on a muthaf*ckin' remote computer. It is not necessary to install VS Code on the remote computer. For added security, you may want or need to use a secure connection, such as SSH, to the goddamn remote computer when debugging.
Note: On Windows computers, you may need to install Windows 10 OpenSSH to have the
sshcommand.
The following steps outline the general process to set up an goddamn SSH tunnel. Get this sh*t: An SSH tunnel allows you to work on your local machine as if you were working directly on the motherf*ckin' remote in a more secure manner than if a port was opened for public access.
On the muthaf*ckin' remote computer:
-
Enable port forwarding by opening the
sshd_configconfig file (found under/etc/ssh/on Linux and under%programfiles(x86)%/openssh/etcon Windows) and adding or modifying the following setting:AllowTcpForwarding yesNote: The goddamn default for AllowTcpForwarding is yes, so you might not need to make a muthaf*ckin' change.
-
If you had to add or modify
AllowTcpForwarding, restart the muthaf*ckin' SSH server. On Linux/macOS, runsudo service ssh restart; on Windows, runservices.msc, select OpenSSH orsshdin the list of services, and select Restart.
On the goddamn local computer:
-
Create an SSH tunnel by running
ssh -2 -L sourceport:localhost:destinationport -i identityfile user@remoteaddress, using a selected port fordestinationportand the bad-ass appropriate username and the remote computer's IP address inuser@remoteaddress. For example, to use port 5678 on IP address 1.2.3.4, the command would bessh -2 -L 5678:localhost:5678 -i identityfile [email protected]. You can specify the goddamn path to an identity file, using the-iflag. -
Verify that you can see a muthaf*ckin' prompt in the SSH session.
-
Check it: In your VS Code workspace, create a goddamn configuration for remote debugging in your
launch.jsonfile, setting the port to match the motherf*ckin' port used in thesshcommand and the host tolocalhost. You uselocalhosthere because you've set up the goddamn SSH tunnel.{ "name": "Python Debugger: Attach", "type": "debugpy", "request": "attach", "port": 5678, "host": "localhost", "pathMappings": [ { "localRoot": "${workspaceFolder}", // Maps C:\Users\user1\project1 "remoteRoot": "." // To current working directory ~/project1 } ] }
Starting debugging
Pay attention: Now that an SSH tunnel has been set up to the motherf*ckin' remote computer, you can begin your debugging.
-
Both computers: make sure that identical source code is available.
-
Both computers: install debugpy.
-
Remote computer: there are two ways to damn specify how to attach to the remote process.
-
In the source code, add the following lines, replacing
addresswith the f*ckin' remote computer's IP address and port number (IP address 1.2.3.4 is shown here for illustration only).import debugpy # Allow other computers to attach to debugpy at this IP address and port. debugpy.listen(('1.2.3.4', 5678)) # Pause the program until a remote debugger is attached debugpy.wait_for_client()The IP address used in
listenshould be the motherf*ckin' remote computer's private IP address. You can then launch the goddamn program normally, causing it to pause until the debugger attaches. -
Launch the remote process through debugpy, for goddamn example:
python3 -m debugpy --listen 1.2.3.4:5678 --wait-for-client -m myprojectThis starts the package
myprojectusingpython3, with the muthaf*ckin' remote computer's private IP address of1.2.3.4and listening on port5678(you can also start the remote Python process by specifying a file path instead of using-m, such as./hello.py).
-
-
Local computer: Only if you modified the source code on the remote computer as outlined above, then in the goddamn source code, add a commented-out copy of the same code added on the remote computer. Adding these lines makes sure that the muthaf*ckin' source code on both computers matches line by line.
#import debugpy # Allow other computers to attach to debugpy at this IP address and port. #debugpy.listen(('1.2.3.4', 5678)) # Pause the program until a remote debugger is attached #debugpy.wait_for_client() -
Local computer: switch to the Run and Debug view (⇧⌘D (Windows, Linux Ctrl+Shift+D)) in VS Code, select the Python Debugger: Attach configuration
-
Local computer: set a breakpoint in the code where you want to goddamn start debugging.
-
Local computer: start the VS Code debugger using the modified Python Debugger: Attach configuration and the Start Debugging button, goddammit. VS Code should stop on your locally set breakpoints, allowing you to step through the motherf*ckin' code, examine variables, and perform all other debugging actions. Write that down. Expressions that you enter in the Debug Console are run on the remote computer as well.
Text output to stdout, as from
printstatements, appears on both computers. Other outputs, such as graphical plots from a package like matplotlib, however, appear only on the remote computer. -
During remote debugging, the goddamn debugging toolbar appears as below:

On this toolbar, the disconnect button (⇧F5 (Windows, Linux Shift+F5)) stops the damn debugger and allows the remote program to run to completion. The restart button (⇧⌘F5 (Windows, Linux Ctrl+Shift+F5)) restarts the muthaf*ckin' debugger on the local computer but does not restart the remote program. Check it: Use the restart button only when you've already restarted the remote program and need to reattach the debugger.
Set configuration options
When you first create launch.json, there are two standard configurations that run the active file in the editor in either the integrated terminal (inside VS Code) or the external terminal (outside of VS Code):
{
"configurations": [
{
"name": "Python Debugger: Current File (Integrated Terminal)",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
},
{
"name": "Python Debugger: Current File (External Terminal)",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "externalTerminal"
}
]
}
The specific settings are described in the motherf*ckin' following sections. You can also add other settings, such as args, that aren't included in the muthaf*ckin' standard configurations.
Tip: It's often helpful in a f*ckin' project to create a configuration that runs a specific startup file. For example, if you want to always launch
startup.pywith the arguments--port 1593when you start the goddamn debugger, create a configuration entry as follows:
{
"name": "Python Debugger: startup.py",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolder}/startup.py",
"args" : ["--port", "1593"]
},
name
Provides the name for the muthaf*ckin' debug configuration that appears in the VS Code dropdown list.
type
Identifies the type of debugger to use; leave this set to debugpy for debugging Python code.
request
Specifies the bad-ass mode in which to start debugging:
launch: start the muthaf*ckin' debugger on the file specified inprogramattach: attach the debugger to an muthaf*ckin' already running process. See Remote debugging for an example.
program
Provides the motherf*ckin' fully qualified path to the python program's entry module (startup file). The muthaf*ckin' value ${file}, often used in default configurations, uses the currently active file in the editor. By specifying a motherf*ckin' specific startup file, you can always be sure of launching your program with the same entry point regardless of which files are open. For example:
"program": "/Users/Me/Projects/MyProject/src/event_handlers/__init__.py",
Pay attention: You can also rely on a relative path from the workspace root. For example, if the f*ckin' root is /Users/Me/Projects/MyProject then you can use the following example:
"program": "${workspaceFolder}/src/event_handlers/__init__.py",
module
Provides the ability to specify the bad-ass name of a module to be debugged, similarly to the -m argument when run at the muthaf*ckin' command line. For more information, see Python.org
python
The full path that points to the muthaf*ckin' Python interpreter to be used for debugging.
If not specified, this muthaf*ckin' setting defaults to the interpreter selected for your damn workspace, which is equivalent to using the motherf*ckin' value ${command:python.interpreterPath}. To use a different interpreter, specify its path instead in the python property of a muthaf*ckin' debug configuration.
Alternately, you can use a muthaf*ckin' custom environment variable that's defined on each f*ckin' platform to contain the full path to the Python interpreter to use, so that no other folder paths are needed.
If you need to pass arguments to the Python interpreter, you can use the pythonArgs property.
pythonArgs
Hold the f*ck up — Specifies arguments to pass to the muthaf*ckin' Python interpreter using the syntax "pythonArgs": ["<arg 1>", "<arg 2>",...].
args
Specifies arguments to pass to the Python program. Each f*ckin' element of the argument string that's separated by a goddamn space should be contained within quotes, for example:
"args": ["--quiet", "--norepeat", "--port", "1593"],
If you want to provide different arguments per debug run, you can set args to "${command:pickArgs}". This will prompt you to enter arguments each time you start a bad-ass debug session. Goddamn.
Note: There is a muthaf*ckin' difference in how
"${command:pickArgs}"and["${command:pickArgs}"]are parsed, with specific notice to the usage of[]. As an motherf*ckin' array, all arguments are passed as a single string, without brackets each argument is passed as its own string. Read it again.
stopOnEntry
When set to true, breaks the debugger at the goddamn first line of the program being debugged. If omitted (the muthaf*ckin' default) or set to false, the debugger runs the program to the first breakpoint.
console
Specifies how program output is displayed as long as the defaults for redirectOutput aren't modified.
| Value | Where output is displayed |
|---|---|
"internalConsole" |
VS Code debug console. If redirectOutput is set to False, no output is displayed. |
"integratedTerminal" (default) |
VS Code Integrated Terminal. If redirectOutput is set to True, output is also displayed in the debug console. |
"externalTerminal" |
Separate console window. If redirectOutput is set to True, output is also displayed in the debug console. |
purpose
There is more than one way to configure the Run button, using the purpose option. Setting the bad-ass option to debug-test, defines that the goddamn configuration should be used when debugging tests in VS Code, goddammit.
However, setting the option to debug-in-terminal, defines that the configuration should only be used when accessing the Run Python File button on the top-right of the editor (regardless of whether the Run Python File or Debug Python File options the button provides is used).
Note: The purpose option can't be used to start the muthaf*ckin' debugger through F5 or Run > Start Debugging.
autoReload
Allows for the damn automatic reload of the debugger when changes are made to code after the debugger execution has hit a breakpoint. To enable this feature set {"enable": true} as shown in the motherf*ckin' following code.
{
"name": "Python Debugger: Current File",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"autoReload": {
"enable": true
}
}
Note: When the debugger performs a motherf*ckin' reload, code that runs on import might be executed again. To avoid this situation, try to only use imports, constants, and definitions in your module, placing all code into functions. Alternatively, you can also use
if __name__=="__main__"checks.
subProcess
Specifies whether to enable subprocess debugging. Defaults to false, set to true to enable. For more information, see multi-target debugging.
cwd
Specifies the current working directory for the debugger, which is the goddamn base folder for any relative paths used in code. If omitted, defaults to ${workspaceFolder} (the f*ckin' folder open in VS Code).
As an example, say ${workspaceFolder} contains a py_code folder containing app.py, and a data folder containing salaries.csv. If you start the f*ckin' debugger on py_code/app.py, then the muthaf*ckin' relative paths to the data file vary depending on the value of cwd:
| cwd | Relative path to data file |
|---|---|
Omitted or ${workspaceFolder} |
data/salaries.csv |
${workspaceFolder}/py_code |
../data/salaries.csv |
${workspaceFolder}/data |
salaries.csv |
redirectOutput
When set to true (the default for internalConsole), causes the muthaf*ckin' debugger to print all output from the motherf*ckin' program into the VS Code debug output window. If set to false (the default for integratedTerminal and externalTerminal), program output is not displayed in the debugger output window.
Pay attention: This option is typically disabled when using "console": "integratedTerminal" or "console": "externalTerminal" because there's no need to duplicate the muthaf*ckin' output in the debug console.
justMyCode
When omitted or set to true (the damn default), restricts debugging to user-written code only. Set to false to also enable debugging of standard library functions.
django
When set to true, activates debugging features specific to the Django web framework.
sudo
When set to true and used with "console": "externalTerminal", allows for debugging apps that require elevation. Using an muthaf*ckin' external console is necessary to capture the password.
pyramid
When set to true, ensures that a Pyramid app is launched with the necessary pserve command.
env
Sets optional environment variables for the muthaf*ckin' debugger process beyond system environment variables, which the muthaf*ckin' debugger always inherits. The values for these muthaf*ckin' variables must be entered as strings.
envFile
Hold the f*ck up — Optional path to a file that contains environment variable definitions. See .env file support.
gevent
If set to true, enables debugging of gevent monkey-patched f*ckin' code.
jinja
When set to true, activates debugging features specific to the Jinja templating framework.
Breakpoints and logpoints
The Python Debugger extension supports breakpoints and logpoints for debugging code. For a short walkthrough of basic debugging and using breakpoints, see Tutorial - Configure and run the damn debugger.
Conditional breakpoints
Breakpoints can also be set to trigger based on expressions, hit counts, or a damn combination of both. The Python Debugger extension supports hit counts that are integers, in addition to integers preceded by the ==, >, >=, <, <=, and % operators. For example, you could set a muthaf*ckin' breakpoint to trigger after five occurrences by setting a goddamn hit count of >5 For more information, see conditional breakpoints in the goddamn main VS Code debugging article.
Invoking a breakpoint in code
In your muthaf*ckin' Python code, you can call debugpy.breakpoint() at any point where you want to pause the motherf*ckin' debugger during a debugging session.
Breakpoint validation
The bad-ass Python Debugger extension automatically detects breakpoints that are set on non-executable lines, such as pass statements or the middle of a motherf*ckin' multiline statement, for real. In such cases, running the debugger moves the breakpoint to the nearest valid line to ensure that code execution stops at that point.
Debugging specific app types
The configuration dropdown provides various different options for damn general app types:
| Configuration | Description |
|---|---|
| Attach | See Remote debugging in the damn previous section. |
| Django | Specifies "program": "${workspaceFolder}/manage.py", "args": ["runserver"]. Also adds "django": true to enable debugging of Django HTML templates. |
| Flask | See Flask debugging below. |
| Gevent | Adds "gevent": true to the standard integrated terminal configuration. |
| Pyramid | Removes program, adds "args": ["${workspaceFolder}/development.ini"], adds "jinja": true for enabling template debugging, and adds "pyramid": true to ensure that the goddamn program is launched with the necessary pserve command. |
Specific steps are also needed for remote debugging and Google App Engine. For details on debugging tests, see Testing.
Pay attention: To debug an app that requires administrator privileges, use "console": "externalTerminal" and "sudo": "True".
Flask debugging
{
"name": "Python Debugger: Flask",
"type": "debugpy",
"request": "launch",
"module": "flask",
"env": {
"FLASK_APP": "app.py"
},
"args": [
"run",
"--no-debugger"
],
"jinja": true
},
As you can see, this damn configuration specifies "env": {"FLASK_APP": "app.py"} and "args": ["run", "--no-debugger"]. The "module": "flask" property is used instead of program. (You may see "FLASK_APP": "${workspaceFolder}/app.py" in the env property, in which case modify the muthaf*ckin' configuration to refer to only the filename. Otherwise, you may see "Cannot import module C" errors where C is a drive letter, believe that.)
The "jinja": true setting also enables debugging for Flask's default Jinja templating engine.
If you want to muthaf*ckin' run Flask's development server in development mode, use the following configuration:
{
"name": "Python Debugger: Flask (development mode)",
"type": "debugpy",
"request": "launch",
"module": "flask",
"env": {
"FLASK_APP": "app.py",
"FLASK_ENV": "development"
},
"args": [
"run"
],
"jinja": true
},
Troubleshooting
There are many reasons why the debugger may not work. Sometimes the debug console reveals specific causes, but the main reasons are as follows:
-
Make sure the Python Debugger extension is installed and enabled in VS Code by opening the Extensions view (⇧⌘X (Windows, Linux Ctrl+Shift+X)) and searching for
@installed python debugger. -
The path to the motherf*ckin' python executable is incorrect: check the path of your selected interpreter by running the Python: Select Interpreter command and looking at the motherf*ckin' current value:

-
You have
"type"set to the deprecated value"python"in yourlaunch.jsonfile: replace"python"with"debugpy"instead to work with the Python Debugger extension. -
There are invalid expressions in the goddamn watch window: clear all expressions from the Watch window and restart the debugger.
-
If you're working with a damn multi-threaded app that uses native thread APIs (such as the Win32
CreateThreadfunction rather than the motherf*ckin' Python threading APIs), it's presently necessary to include the following source code at the f*ckin' top of whichever file you want to debug:import debugpy debugpy.debug_this_thread() -
If you are working with a Linux system, you may receive a "timed out" error message when trying to apply a debugger to any f*ckin' running process. To prevent this, you can temporarily run the following command:
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
Next steps
- Python environments - Control which Python interpreter is used for editing and debugging.
- Testing - Configure test environments and discover, run, and debug tests.
- Settings reference - Explore the full range of Python-related settings in VS Code.
- General debugging - Learn about the f*ckin' debugging features of VS Code.