Python mode in Emacs: No such file or directory, pdb

后端 未结 7 1640
南旧
南旧 2020-12-14 11:30

I have a python script that I want to debug with python-mode. I read in this thread that I can debug my python script with M-x pdb, however I get the following

7条回答
  •  南笙
    南笙 (楼主)
    2020-12-14 11:46

    To run the Python Debugger, M-x pdb expects to find an executable named pdb. While the pdb executable may exist in some Python distributions, it doesn't exist in all of them.

    A proposal to fix this is in GNU bug report #21521: pdb default suggested command.

    Until the bug is fixed, you can set the variable gud-pdb-command-name to define the command used to launch pdb. In .emacs, add...

    (setq gud-pdb-command-name "python -m pdb")
    

提交回复
热议问题