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
2
votes
1 answer

how to break out of ipdb debugger?

How do you exit the ipdb debugger? According to this question typing q should just work. I am on Python 3.6.6, Ipython 6.4.0 and that does not work in the following context: I have a function, f(x), that is called from another function in a loop.…
Alex
  • 1,281
  • 1
  • 13
  • 26
2
votes
1 answer

Tab completion in ipdb not working when output is processed

Sometimes I resort to using ipdb for debugging a Python script, which has a very nice autocomplete feature. The problem is, the script usually runs through a shell pipeline that processes its output (for instance python script.py |& tee…
danuker
  • 861
  • 10
  • 26
2
votes
1 answer

Debug and run mode in Jupyter

Like in matlab, is there a possiblity in Jupyter to run a function in debug mode where execution is suspended at breakpoints and in run mode the function ignores the breakpoints? In a simple example like from IPython.core.debugger import…
Waleed
  • 189
  • 1
  • 2
  • 11
2
votes
0 answers

(i)PDB post mortem when using 'unittest discover'

Most of the times when I run my tests, I do this via python -m unittest discover (I'm lazy). Lets say that one of the tests raises an exception. Is there a way to make unittest framework run a post-mortem on it (preferably ipdb.pm()), without…
Błażej Michalik
  • 4,474
  • 40
  • 55
2
votes
1 answer

How to recover from exception when debugging python?

When stepping through the code in pdb, any exception hit immediately ends the program. How do I instead fix the exception and keep debugging? Is there no way to avoid the overhead of restarting the program? It seems like many py debuggers share this…
SwimBikeRun
  • 4,192
  • 11
  • 49
  • 85
2
votes
0 answers

IPython notebook: debugging by stopping the execution at specific point

i want to interactively debug code that is deeply hidden in some class. I know that it is possible open the ipdb using from IPython.core.debugger import Pdb Pdb().set_trace() This work also in ipython (jupyter) notebook. Another possibility that I…
Apoptose
  • 569
  • 1
  • 5
  • 10
2
votes
1 answer

eventlet.monkey_patch() breaks ipdb in docker container

So I am using the micro-servicing python package nameko which runs a service using eventlet and calls eventlet.monkey_patch() on import. I have deciphered that it is this piece of code that is blocking any debug attempts via ipdb. The ipdb console…
steve
  • 537
  • 1
  • 7
  • 17
2
votes
0 answers

python input lag when debugging phantomJS webdriver

so I was trying to debug the tests we have running django/phantomjs/selenium-webdrive with ipdb, but the interactive debugger input was too slow, I need to hold a key for 3-5 seconds to get that character written down. so I tracked it down and find…
Abdallah Alsamman
  • 1,623
  • 14
  • 22
2
votes
1 answer

why help() command under ipdb gives an error

In ipython I can issue following command and it gives me help: In [1]: help(["foo", "bar", "baz"]) class list(object) | list() -> new empty list | list(iterable) -> new list initialized from iterable's items | | Methods defined here: | | …
Wakan Tanka
  • 7,542
  • 16
  • 69
  • 122
2
votes
1 answer

Execute commands automatically when ipdb starts

I usually debug a python script with the help of the ipdb debugger by putting the following line into the source code: import ipdb; ipdb.set_trace() Then when I run the script, ipdb starts. Very often I need to plot numpy arrays in an interactive…
Dmitry Kabanov
  • 710
  • 1
  • 7
  • 20
2
votes
0 answers

Which python interpreter is ipdb using?

I am asking because I encounter something very strange. The following method throws an exception when called from within a script: def gaussian_blur(self, in_array, size): # expand in_array to fit edge of kernel padded_array =…
LarsVegas
  • 6,522
  • 10
  • 43
  • 67
2
votes
1 answer

How can I assign to the ipython global namespace from within ipdb?

I have a traceback in an IPython notebook that I'm debugging with the %debug magic. I'd like to assign one of the objects in the traceback frame to a variable in the IPython global namespace, so that I can mess with it outside the ipdb prompt (which…
Ben Kuhn
  • 1,059
  • 2
  • 10
  • 25
2
votes
1 answer

ipdb / set_trace() hanging

I am new to using ipdb and following the examples have added print "I see this print statement\n" foo="bar" import ipdb ipdb.set_trace() print "Never see this statement because program hangs: print "But if the prior two debugging lines were removed…
WestCoastProjects
  • 58,982
  • 91
  • 316
  • 560
2
votes
0 answers

Rerun code while debugging and while reloading all modules

When debugging my Python code, I run a script through ipdb from the command line, and set a number of breakpoints. Then I make some changes in one or more modules, and rerun. However, if I simply use run modules do not get reloaded. To make sure…
gerrit
  • 24,025
  • 17
  • 97
  • 170
2
votes
0 answers

ipython style tab complete with ipdb for imported modules

I'm trying to get ipython style table complete with pdb by using ipdb. On a clean ubuntu 14.04 install (new aws instance) I run. sudo apt-get update sudo apt-get upgrade -y sudo apt-get install python-setuptools sudo easy_install pip sudo pip…
TristanMatthews
  • 2,451
  • 4
  • 24
  • 34