Questions tagged [ipdb]

Interactive Python Debugger, IPython-interface to pdb

ipdb exports functions to access the IPython debugger, which features tab completion, syntax highlighting, better tracebacks, better introspection with the same interface as the pdb module.

192 questions
160
votes
1 answer

Convert generator object to list for debugging

When I'm debugging in Python using IPython, I sometimes hit a break-point and I want to examine a variable that is currently a generator. The simplest way I can think of doing this is converting it to a list, but I'm not clear on what's an easy way…
Seanny123
  • 8,776
  • 13
  • 68
  • 124
64
votes
4 answers

using ipdb to debug python code in one cell (jupyter or Ipython)

I'm using jupyter (or Ipython) notebook with firefox, and want to debug some python code in the cell. I am using 'import ipdb; ipdb.set_trace()' as kind of breakpoint, for example my cell has the following code: a=4 import ipdb;…
lugger1
  • 1,843
  • 3
  • 22
  • 31
62
votes
3 answers

PDB - stepping out of a function

Can I step out of a function after stepping into it with step while using pdb / ipdb debugger? And if there's no such option - what is the fastest way to get out of the stepped-in function?
Kludge
  • 2,653
  • 4
  • 20
  • 42
60
votes
10 answers

BdbQuit raised when debugging Python with pdb

Recently when adding the pdb debugger to my Python 2.7.10 code, I get this message: Traceback (most recent call last): File "/Users/isaachess/Programming/vivint/Platform/MessageProcessing/vivint_cloud/queues/connectors/amqplib_connector.py", line…
isaachess
  • 739
  • 1
  • 7
  • 15
39
votes
6 answers

Exiting Python Debugger ipdb

I use ipdb fairly often in a way to just jump to a piece of code that is isolated i.e. it is hard to write a real script that uses it. Instead I write a minimal test case with mocking and jump into it. Exemplary for the workflow: def func(): ... …
Joachim
  • 3,210
  • 4
  • 28
  • 43
39
votes
8 answers

Breakpoint-induced interactive debugging of Python with IPython

Say I have an IPython session, from which I call some script: > run my_script.py Is there a way to induce a breakpoint in my_script.py from which I can inspect my workspace from IPython? I remember reading that in previous versions of IPython one…
Amelio Vazquez-Reina
  • 91,494
  • 132
  • 359
  • 564
35
votes
4 answers

Possible to stop generating *.ipdb *.iobj files by VIsual Studio 2015?

In Visual Studio Community 2015, a Visual C++ project generates a *.ipdb file and a *.iobj file in its Release folder. Now in Visual Studio Community 2013, I've never seen these files generated in project Release folder and so I'd like to know - Is…
Neon
  • 453
  • 1
  • 4
  • 7
33
votes
3 answers

How to quit ipdb while in post-mortem debugging?

I like to inspect error in a Python script by using: $ python3 -m pdb my_script.py This drops me into a pdb prompt from where I can c continue the execution, and when it hits error, I can inspect the variables and then q quit the script execution…
Ashwin Nanjappa
  • 76,204
  • 83
  • 211
  • 292
31
votes
2 answers

Await an async function in Python debugger

Is it possible to await arbitrary calls to an async function when inside a Python debugger? Say I have the following code in some main.py file: import asyncio async def bar(x): return x + 1 async def foo(): import ipdb;…
Ivan Gozali
  • 2,089
  • 1
  • 27
  • 25
31
votes
4 answers

Is it possible to remove a break point set with ipdb.set_trace()?

I used ipdb.set_trace() somewhere in my Python code. Is it possible to ignore this break point using a IPDB command? clear tells me that it cleared all break points, but IPDB stops again when it stumbles upon the line with ipdb.set_trace(). disable…
lumbric
  • 7,644
  • 7
  • 42
  • 53
30
votes
4 answers

ipdb debugger, step out of cycle

Is there a command to step out of cycles (say, for or while) while debugging on ipdb without having to use breakpoints out of them? I use the until command to step out of list comprehensions, but don't know how could I do a similar thing, if…
Javier Novoa C.
  • 11,257
  • 13
  • 57
  • 75
26
votes
1 answer

breakpoint() using ipdb by default

Is it possible that installing ipdb (or some other package written to do it explicitely) will result in breakpoint() running ipdb instead of pdb without binding sys.breakpointhook() to ipdb? https://www.python.org/dev/peps/pep-0553/ I'm not asking…
seler
  • 8,803
  • 4
  • 41
  • 54
26
votes
4 answers

ImportError: No module named 'ipdb'

I'm new to python and I'm trying to use the interactive python debugger in the standard python package. Whenever I run "import ipdb" in my text editor (atom) or in the command line through iPython then I get the error: ImportError: No module named…
Erin Wolpert
  • 363
  • 1
  • 5
  • 8
26
votes
3 answers

Possible bug in pdb module in Python 3 when using list generators

After running this code in Python 3: import pdb def foo(): nums = [1, 2, 3] a = 5 pdb.set_trace() foo() The following expressions work: (Pdb) print(nums) [1, 2, 3] (Pdb) print(a) 5 (Pdb) [x for x in nums] [1, 2, 3] but the…
Loax
  • 615
  • 5
  • 11
23
votes
3 answers

How to use ipdb.set_trace in a forked process

I use ipdb.set_trace() whenever I need to set a break point in my code. Right now, I'm trying to use it in a process that I've created using multiprocessing, while the code does stop, I can't type anything to continue debugging. Is there any way to…
Seanny123
  • 8,776
  • 13
  • 68
  • 124
1
2 3
12 13