3

I've run pip install ipdb but when I run import ipdb in iPython I still get the error: ImportError: No module named 'ipdb'

What does this mean?

Similarly, when I'm importing files (with .py extension) in iPython, I'm also getting this error (ImportError: No module named Chapter_1_Python_Syntax) though I've checked the path to the directory and it's correct.

MaartenDev
  • 5,631
  • 5
  • 21
  • 33
Erin Wolpert
  • 363
  • 1
  • 5
  • 8
  • 1
    Can we see some code that you've tried? That way we're more capable of diagnosing the issue. – Sam Jan 15 '16 at 22:31

3 Answers3

3

When I get this error after using 'pip install', closing and restarting the terminal usually solve the problem.

0

I've had problems getting pip installs to work properly for me. Usually I just end up dropping the file/folder with the rest of the libraries. You can just drop it here: C:\Python27\Lib\site-packages and then just import it in your python script and should be good to go.

Steve Smith
  • 168
  • 2
  • 10
0

ipdb comes with ipython, so if you already have ipython installed, you can access ipdb through that package using:

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

Then you could use ipdb just as you though you had done import ipdb, like:

ipdb.runcall(self, fun, *args, **kwds)
ipdb.run(self, cmd, globals = None, locals = None)

If you don't have ipython installed, you can just use pdb which is the built-in debugger.

Anamitra Musib
  • 336
  • 4
  • 5