0

It seems I'm some kind of rare plant... I have to debug python scripts in windows 7, 64bit. And since I use it for everything, especially as an IDE, I would like to do it in emacs.

But I'm just not able to do so: M-x pdb gives me this error:

Traceback (most recent call last):
  File "c:\programdata\anaconda3\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\programdata\anaconda3\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "c:\ProgramData\Anaconda3\Scripts\pdb.exe\__main__.py", line 5, in <module>
ModuleNotFoundError: No module named 'pdb.pdb'; 'pdb' is not a package

Debugger exited abnormally with code 1

There is no pdb.exe available in my anaconda distribution, and I have not been able to find such a program.

I installed winpdb and tried rpdb2 instead of pdb. It starts, but there doesn't seem to be any emacs integration.

Since emacs, python and windows are involved, I thought this is the correct forum, but I' not sure.

I'm using emacs 25.2, python 3.6.1 and am a python rookie.

3
  • Does this happen even before it asks you how to run pdb? If not, what do you enter in that prompt? Commented Jun 26, 2017 at 16:05
  • It happened after it asks how to run pdb. I just accepted the default, because I didn't know that pdb is not a separate program... Commented Jun 27, 2017 at 10:06
  • That's correct.. I see you answered your question too! Commented Jun 27, 2017 at 12:46

2 Answers 2

3

The solution is to run pdb like this:

python -m pdb  "test_rtc.py"
Sign up to request clarification or add additional context in comments.

Comments

1

I personally prefer the realgud package

Then add this to your init file:

(defun sdev/init-realgud
  (interactive)
  (load-library "realgud"))  
(sdev/init-realgud 1)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.