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 191 users
Languages   Python 92.8% | Cython 2.9% | Shell 1.8% | C++ 1.5% | Roff 0.8% | Perl 0.1%
🌐
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.
🌐
Visual Studio Marketplace
marketplace.visualstudio.com › items
Python Debugger - Visual Studio Marketplace
Extension for Visual Studio Code - Python Debugger extension using debugpy.
🌐
debugpy
debugpy.com
Home - debugpy
Debugpy is a powerful and lightweight debugging tool designed to simplify the Python development process. It enables developers to easily inspect code, set breakpoints, analyze variables, and troubleshoot issues in real time.
🌐
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
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
🌐
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 - Visual Studio can launch and debug Python applications locally and remotely on a Windows computer. Visual Studio also supports debugging remotely on a different operating system, device, or Python implementation other than CPython by using the debugpy library.
🌐
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
🌐
Anaconda.org
anaconda.org › conda-forge › debugpy
debugpy - conda-forge
January 29, 2026 - Organization created on Apr 11, 2015 · A community-led collection of recipes, build infrastructure, and distributions for the conda package manager
🌐
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 › microsoft › vscode-python-debugger
GitHub - microsoft/vscode-python-debugger: Python debugger (debugpy) extension for VS Code. · GitHub
A Visual Studio Code extension that supports Python debugging with debugpy. Python Debugger provides a seamless debugging experience by allowing you to set breakpoints, step through code, inspect variables, and perform other essential debugging ...
Starred by 166 users
Forked by 95 users
Languages   TypeScript 97.8% | Python 1.9%
🌐
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 - Learn how to debug production Python code in VSCode using debugpy for efficient troubleshooting in Django and beyond.