In addition to my comment earlier and your subsequent update to the question:
First print the value for $PATH , which works in your terminal. Use which pdb to find where the pdb executable is located.
Then set the $PATH environment variable explicitly in Emacs and synchronize it with exec-path as follows:
(setenv "PATH" "/usr/local/bin:/usr/bin:/bin:/some/other/dir") (setq exec-path (split-string (getenv "PATH") path-separator))
You may also need to explicitly specify PYTHONPATH or similar environment variables; you can do this using lines like the "setenv" line above, or just use exec-path-from-shell elisp package .
Update
Ok, so the Emacs pdb command is not provided by python-mode , and it expects to find an executable file called "pdb". An easy way to fix this, then create a shell wrapper called "pdb" in your $ PATH directory:
#!/bin/sh exec python -m pdb "$@"
(I found a note here suggesting this technique.)
Equivalent for Windows would be a pdb.bat file containing:
python -u -m pdb %1
( -u prevents Python output buffering).
sanityinc Feb 07 2018-12-12T00: 00Z
source share