/ tech-note

%xmode command to alter the verbosity of the error stack in IPython

In IPython, you can alter the verbosity of the stack trace caused by an error in your program via %xmode magic command.

%xmode Verbose

The default is Context. You can show fewer information via Plain, or more information via Verbose.

If you stuck an error you find hard to resolve, try %xmode and set it to Verbose to gain deeper insights on your error.

NOTE: If you use Verbose, there might feel too many traces to track. That is why it is set to Context in default.

How to enable it always on the IPython launch

Write it in your startup script. The location is $IPYTHONDIR/profile_default/startup/startup.py, unless you set it differently (the default location for $IPYTHONDIR is ~/).

%xmode Verbose