1

I can't install the ipdb package because it's on a server over which I have no control. I want to make the following work.

import other.module.ipdb as ipdb

print 'hello'
ipdb.set_trace()
print 'world'

Ipython is installed which makes me think I should somehow be able to access the ipdb package. I know locally I did installed it by doing sudo apt-get install python-ipdb but it seems that ipdb should already be available somehow.

Any ideas?

Thank you

evan54
  • 3,585
  • 5
  • 34
  • 61

1 Answers1

0

You are right that IPython comes with everything you need to be able to use the ipdb package. Here's how you can access it as long as you have IPython installed:

from IPython.core.debugger import Pdb
ipdb = Pdb()

Then you can use ipdb just as though you had done import ipdb, such as:

ipdb.runcall(self, func, *args, **kwds)
ipdb.run(self, cmd, globals=None, locals=None)
# etc.
Scott H
  • 2,644
  • 1
  • 24
  • 28