2017-12-09 19 views
4

PythonDebuggingToolsドキュメントは、Pythonデバッガpdbは、「すべてのPythonのインストールの一部」である、まだ私はMacOSのハイシエラの下でそれを見つけることができないことを言う:PythonのデバッガPDB

pdb: command not found 

ですそれは最近のMacOSの通常の部分としてインストールされるはずですか?

答えて

9

pdbというコマンドはありませんが、あなたがシェルからPDBを呼び出すことができます:あなたはits docpdbを呼び出すために、より多くの方法を読むことができる

python -m pdb your_script.py 

0

あなたはIPythonを使用している場合、デバッガは、あなたがピップまたはcondaのいずれかでIPythonをインストールする必要があります

IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help. 

In [1]: %pdb 
Automatic pdb calling has been turned ON 

In [2]: %pdb 
Automatic pdb calling has been turned OFF 

In [3]: ?pdb 
Docstring: 
Control the automatic calling of the pdb interactive debugger. 

Call as '%pdb on', '%pdb 1', '%pdb off' or '%pdb 0'. If called without 
argument it works as a toggle. 

When an exception is triggered, IPython can optionally call the 
interactive pdb debugger after the traceback printout. %pdb toggles 
this feature on and off. 

The initial state of this feature is set in your configuration 
file (the option is ``InteractiveShell.pdb``). 

If you want to just activate the debugger AFTER an exception has fired, 
without having to type '%pdb on' and rerunning your code, you can use 
the %debug magic. 
File:  ~/anaconda/envs/py36/lib/python3.6/site-packages/IPython/core/magics/execution.py 

を使用して呼び出すことができます。

関連する問題