Did you add a breakpoint?

debugpy.breakpoint()

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() #must have
print('break on this line')

Ref: https://code.visualstudio.com/docs/python/debugging

Answer from Tiana987642 on Stack Overflow
🌐
PyPI
pypi.org › project › debugpy
debugpy · PyPI
Python :: 3.14 · Topic · Software Development :: Debuggers · Report project as malware · debugpy is an implementation of the Debug Adapter Protocol for Python. The source code and the issue tracker is hosted on GitHub.
      » pip install debugpy
    
Published   Jan 29, 2026
Version   1.8.20
🌐
GitHub
github.com › microsoft › debugpy
GitHub - microsoft/debugpy: An implementation of the Debug Adapter Protocol for Python · GitHub
An implementation of the Debug Adapter Protocol for Python - microsoft/debugpy
Starred by 2.4K users
Forked by 192 users
Languages   Python 92.8% | Cython 2.9% | Shell 1.8% | C++ 1.5% | Roff 0.8% | Perl 0.1%
People also ask

Which Python versions does Debugpy support?
Debugpy supports Python 3.6 and above.
🌐
debugpy.com
debugpy.com
Debugpy – Fast & Efficient Python Debugging Tool
What is Debugpy?
Debugpy is a Python debugger that integrates seamlessly with VS Code and other IDEs, allowing developers to debug Python scripts and applications efficiently.
🌐
debugpy.com
debugpy.com
Debugpy – Fast & Efficient Python Debugging Tool
Does Debugpy support multi-threaded debugging?
Yes, it can debug multi-threaded Python applications, but some features may have limitations.
🌐
debugpy.com
debugpy.com
Debugpy – Fast & Efficient Python Debugging Tool
🌐
Visual Studio Code
code.visualstudio.com › docs › python › debugging
Python debugging in VS Code
November 3, 2021 - In the terminal, install the debugpy package. In the terminal, start Python with the script, for example, python3 myscript.py.
🌐
debugpy
debugpy.com
Debugpy – Fast & Efficient Python Debugging Tool
Debugpy – Fast & Efficient Python Debugging Tool
Debugpy is a lightweight Python debugger that helps developers inspect code, set breakpoints, and troubleshoot in real time with ease. #Debugpy
Rating: 4.5 ​
🌐
Visual Studio Marketplace
marketplace.visualstudio.com › items
Python Debugger - Visual Studio Marketplace
Extension for Visual Studio Code - Python Debugger extension using debugpy.
Find elsewhere
🌐
Amit Chaudhary
amitness.com › notes › debugpy
How to use debugpy in VSCode - Amit Chaudhary
April 2, 2025 - python -m debugpy --listen 0.0.0.0:5678 --wait-for-client \ -m uvicorn main:app --host 0.0.0.0 --port 8000
🌐
Arch Linux
archlinux.org › packages › extra › x86_64 › python-debugpy
Arch Linux - python-debugpy 1.8.20-1 (x86_64)
View the file list for python-debugpy · View the soname list for python-debugpy · Copyright © 2002-2026 Judd Vinet, Aaron Griffin and Levente Polyák. The Arch Linux name and logo are recognized trademarks. Some rights reserved.
🌐
PyPI
pypi.org › project › debugpy-run
debugpy-run · PyPI
If you have the VS Code Python extension installed then the full debugpy debugger is already bundled with it. You open a terminal window and run this utility to invoke your program with arguments. The utility finds the path where debugpy is installed and then runs it for the program and arguments ...
      » pip install debugpy-run
    
Published   Nov 06, 2025
Version   1.16
🌐
NI
ni.com › docs › en-US › bundle › teststand › page › debug-python-modules.html
Debugging Python Modules - NI
Before you can step into Python modules, you must install the following software and configure the Python Adapter: Install the debugpy package in Python.
🌐
Anaconda.org
anaconda.org › conda-forge › debugpy
debugpy - conda-forge | Anaconda.org
January 29, 2026 - Install debugpy with Anaconda.org. An implementation of the Debug Adapter Protocol for Python
🌐
Microsoft Learn
learn.microsoft.com › en-us › visualstudio › python › debugging-python-code-on-remote-linux-machines
Debug Python code on remote Linux computers - Visual Studio (Windows) | Microsoft Learn
December 11, 2025 - In Visual Studio 2019 version 16.5 and later, the debugpy library replaces ptvsd. When you use debugpy, the Python code being debugged hosts the debug server to which Visual Studio can attach.
🌐
Medium
medium.com › @ogretenahmetcan › debugging-production-python-code-with-vscode-django-as-an-example-fbb9c76ae68c
Debugging Production Python Code with VSCode (Django as an example) | Medium
November 1, 2024 - We’ll go beyond the limitations of excessive logging and error-prone transfers. Instead, we’ll introduce you to debugpy, a game-changing tool that allows you to debug your production code just as easily as you would debug it locally.
🌐
piwheels
piwheels.org › project › debugpy
piwheels - debugpy
February 11, 2026 - The piwheels project page for debugpy: An implementation of the Debug Adapter Protocol for Python
🌐
GitHub
github.com › bulletmark › debugpy-run
GitHub - bulletmark/debugpy-run: Finds and runs debugpy for VS Code "remote attach" command line debugging. · GitHub
If you have the VS Code Python extension installed then the full debugpy debugger is already bundled with it. You open a terminal window and run this utility to invoke your program with arguments. The utility finds the path where debugpy is installed and then runs it for the program and arguments ...
Starred by 93 users
Forked by 3 users
Languages   Python 95.2% | Just 4.8%
🌐
GitHub
github.com › microsoft › debugpy › wiki › Ramping-up-on-debugpy
Ramping up on debugpy
An implementation of the Debug Adapter Protocol for Python - microsoft/debugpy
Author   microsoft