So I have opened a buffer where a python script is loaded. I do M-x load-library RET and after that realgud:pdb. Then I get pdb /path_to_script/main_func.py which is ok. After pressing enter I get the error (file-error "Searching for program" "No such file or directory" "pdb")

So how do I get around this. From what I understand and have seen so far pdb is not a standalone executable. It's a module that is imported into the code directly. But from what I can get here there are no further steps required to run it (no import as well?). So what am I missing?

I'm on OS X and emacs 25.2 (9)


There are a couple of possibilities. First, you could create a pdb shell script that invokes pdb. For example:

python -m pdb $@

Or when you are asked Run pdb like this (pdb ...) enter, well, the command you want to run, e.g. python -m pdb ...

If someone wants to beef up the realgud code to special-case the python debugger (and IMHO too much of Python and the Python ecosystem is its own special case which leads to confusion like this), I'll accept a pull request.

Also, I've added this info off of the link cited.

  • 4
    Add to .emacs: (setq realgud:pdb-command-name "python -m pdb")
    – Harvey
    May 25 '18 at 14:15

Probably pdb command is messed up with the password database package.

I use ipdb which just works. You have to pip install ipdb first. And then do M-x realgud:ipdb.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.