Python debugger pdb не найден на macOS High Sierra



ДокументацияPythonDebuggingTools гласит, что отладчик Pythonpdb является "частью всех установок Python", но я не могу найти его под macOS High Sierra:



pdb: command not found


Предполагается ли, что он будет установлен как обычная часть macOS в эти дни?

688   2  

2 ответов:

Нет команды с именем pdb, но вы можете вызвать pdb из оболочки с помощью:

python -m pdb your_script.py

Вы можете прочитать больше методов для вызова pdb в его doc.

Если вы используете 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

Возможно, вам потребуется установить IPython с помощью pip или conda.

Comments

    Ничего не найдено.