🌐
Visual Studio Marketplace
marketplace.visualstudio.com › items
Python Debugger - Visual Studio Marketplace
Extension for Visual Studio Code - Python Debugger extension using debugpy.
🌐
Python
docs.python.org › 3 › library › pdb.html
pdb — The Python Debugger
Source code: Lib/pdb.py The module pdb defines an interactive source code debugger for Python programs. It supports setting (conditional) breakpoints and single stepping at the source line level, i...
🌐
PyPI
pypi.org › project › pudb
pudb · PyPI
Ability to control the debugger from a separate terminal. ... Should work with Python 3.6 and newer. (Versions 2019.2 and older continue to support Python 2.7.) ... PuDB also has a mailing list that you may use to submit patches and requests for help. You can also send a pull request to the GitHub repository · You may obtain the development version using the Git version control tool.: ... You may also browse the code online. ... Download the file for your platform.
      » pip install pudb
    
Published   Dec 06, 2025
Version   2025.1.5
🌐
GitHub
github.com › microsoft › vscode-python-debugger › releases
Releases · microsoft/vscode-python-debugger
Python debugger (debugpy) extension for VS Code. Contribute to microsoft/vscode-python-debugger development by creating an account on GitHub.
Author   microsoft
🌐
Visual Studio Code
code.visualstudio.com › docs › python › debugging
Python debugging in VS Code
November 3, 2021 - The Python extension supports debugging through the Python Debugger extension for several types of Python applications. For a short walkthrough of basic debugging, see Tutorial - Configure and run the debugger. Also see the Flask tutorial.
🌐
PyPI
pypi.org › project › debugpy
debugpy · PyPI
Download URL: debugpy-1.8.20-cp314-cp314-win_amd64.whl
      » pip install debugpy
    
Published   Jan 29, 2026
Version   1.8.20
🌐
OnlineGDB
onlinegdb.com › online_python_debugger
Online Python Debugger - online editor
OnlineGDB is online IDE with python debugger. Easy way to debug python program online. Debug with online pdb console.
Find elsewhere
🌐
GitHub
github.com › inducer › pudb
GitHub - inducer/pudb: Full-screen console debugger for Python · GitHub
Full-screen console debugger for Python. Contribute to inducer/pudb development by creating an account on GitHub.
Starred by 3.2K users
Forked by 240 users
Languages   Python
Top answer
1 of 15
409

Yes! There's a Python debugger called pdb just for doing that!

You can launch a Python program through pdb via python -m pdb myscript.py.

There are a few commands you can then issue, which are documented on the pdb page.

Some useful ones to remember are:

  • b: set a breakpoint
  • c: continue debugging until you hit a breakpoint
  • s: step through the code
  • n: to go to next line of code
  • l: list source code for the current file (default: 11 lines including the line being executed)
  • u: navigate up a stack frame
  • d: navigate down a stack frame
  • p: to print the value of an expression in the current context

If you don't want to use a command line debugger, some IDEs like Pydev, Wing IDE or PyCharm have a GUI debugger. Wing and PyCharm are commercial products, but Wing has a free "Personal" edition, and PyCharm has a free community edition.

2 of 15
87

By using Python Interactive Debugger 'pdb'

First step is to make the Python interpreter enter into the debugging mode.

A. From the Command Line

Most straight forward way, running from command line, of python interpreter

$ python -m pdb scriptName.py
> .../pdb_script.py(7)<module>()
-> """
(Pdb)

B. Within the Interpreter

While developing early versions of modules and to experiment it more iteratively.

$ python
Python 2.7 (r27:82508, Jul  3 2010, 21:12:11)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pdb_script
>>> import pdb
>>> pdb.run('pdb_script.MyObj(5).go()')
> <string>(1)<module>()
(Pdb)

C. From Within Your Program

For a big project and long-running module, can start the debugging from inside the program using import pdb and set_trace() like this:

#!/usr/bin/env python
# encoding: utf-8
#

import pdb

class MyObj(object):
    count = 5
    def __init__(self):
        self.count= 9

    def go(self):
        for i in range(self.count):
            pdb.set_trace()
            print i
        return

if __name__ == '__main__':
    MyObj(5).go()

Step-by-Step debugging to go into more internal

  1. Execute the next statement… with “n” (next)

  2. Repeating the last debugging command… with ENTER

  3. Quitting it all… with “q” (quit)

  4. Printing the value of variables… with “p” (print)

    a) p a

  5. Turning off the (Pdb) prompt… with “c” (continue)

  6. Seeing where you are… with “l” (list)

  7. Stepping into subroutines… with “s” (step into)

  8. Continuing… but just to the end of the current subroutine… with “r” (return)

  9. Assign a new value

    a) !b = "B"

  10. Set a breakpoint

    a) break linenumber

    b) break functionname

    c) break filename:linenumber

  11. Temporary breakpoint

    a) tbreak linenumber

  12. Conditional breakpoint

    a) break linenumber, condition

Note: All these commands should be executed from pdb

For in-depth knowledge, refer:

  • https://pymotw.com/2/pdb/

  • https://pythonconquerstheuniverse.wordpress.com/2009/09/10/debugging-in-python/

🌐
JetBrains
jetbrains.com › help › pycharm › debugger-python.html
Debugger | PyCharm Documentation
Use this page to configure Python debug options. The debugger contains speedup modules, which use Cython and are generated with a few changes in the regular files to cythonize the files.
🌐
Reddit
reddit.com › r/learnpython › how to debug python 3.6 in vscode?
r/learnpython on Reddit: How to debug Python 3.6 in VSCode?
February 1, 2024 -

My Python debugger is broken (I am using Python 3.6, I can't change it because this isn't my project) since it only supports Python 3.7+. "The debugger in the python extension no longer supports python versions minor than 3.7."

I've heard that debugpy exists and theoretically supports Python 3.6, but I have no idea how to use it (how is it different from the base Python Debugger in vscode). I currently have Python Debugger v2024.0.0 installed, and its description is "Python Debugger extension using 'debugpy'" but it won't let me debug my Python 3.6 code. I tried installing an older version, but when I navigate to that option, it only shows me 2024.0.0 (current) and no other options. Seeing other people do it (with other extensions at least), they have hundreds of options, from like every single month.

I have no idea what to do, I don't use extensions besides the debugger so I have no idea what's going on. I turned off auto-updates and set it to manual, but I haven't been able to fix it.
Has anyone been able to debug Python 3.6 in VSCode, and if so, how?

🌐
Python
wiki.python.org › moin › PythonDebuggingTools
PythonDebuggingTools - Python Wiki
For current information, please visit python.org. If a change to this archive is absolutely needed, requests can be made via the infrastructure@python.org mailing list. Add your useful tools here -- editors, debuggers and other utils that really help with the process.:
🌐
PyPI
pypi.org › project › web-pdb
web-pdb · PyPI
The debugger icon made by Freepik from www.flaticon.com is licensed by CC 3.0 BY. ... Download the file for your platform.
      » pip install web-pdb
    
Published   Nov 16, 2024
Version   1.6.3
🌐
Python
docs.python.org › 3 › library › debug.html
Debugging and Profiling — Python 3.14.3 documentation
These libraries help you with Python development: the debugger enables you to step through code, analyze stack frames and set breakpoints etc., and the profilers run code and give you a detailed br...
🌐
Real Python
realpython.com › python-debugging-pdb
Python Debugging With Pdb – Real Python
May 19, 2023 - The example code in this tutorial uses Python 3.6. You can find the source code for these examples on GitHub. At the end of this tutorial, there is a quick reference for Essential pdb Commands. There’s also a printable pdb Command Reference you can use as a cheat sheet while debugging:
🌐
Microsoft Learn
learn.microsoft.com › en-us › visualstudio › python › debugging-symbols-for-mixed-mode-c-cpp-python
Symbols for mixed-mode Python/C++ debugging - Visual Studio (Windows) | Microsoft Learn
For Python 3.5 and later, acquire the debug symbols through the Python installer. Select Custom installation, then select Next. On the Advanced Options page, select the boxes for Download debugging symbols and Download debug binaries:
🌐
Amrdraz
amrdraz.github.io › python-debugger
Python Debugger
An offline ready JavaScript based Python runner and debugger