debugger.rst 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. .. _debugger:
  2. Debugger
  3. ========
  4. JupyterLab 3.0 now ships with a Debugger front-end by default.
  5. This means that notebooks, code consoles and files can now be debugged from JupyterLab directly!
  6. Requirements
  7. ------------
  8. For the debugger to be enabled and visible, a kernel with support for debugging is required.
  9. For now ``xeus-python`` is the only Jupyter Kernels for Python that supports debugging.
  10. However other Jupyter Kernels can also support debugging and be compatible with the JupyterLab debugger
  11. by implementing the `Jupyter Debugger Protocol <https://jupyter-client.readthedocs.io/en/latest/messaging.html#debug-request>`_.
  12. To install ``xeus-python`` in a new ``conda`` environment:
  13. .. code:: bash
  14. conda create -n jupyterlab-debugger -c conda-forge jupyterlab=3 xeus-python
  15. conda activate jupyterlab-debugger
  16. Usage
  17. -----
  18. ``xeus-python`` can be selected from the JupyterLab launcher:
  19. .. image:: ./images/debugger/xpython-launcher.png
  20. Alternatively, it is also possible to switch to the `xpython` kernel using the kernel selection dialog:
  21. .. image:: ./images/debugger/kernel-selection.gif
  22. Enable the debugger, set breakpoints and step into the code:
  23. .. image:: ./images/debugger/step.gif
  24. Tutorial Notebook
  25. -----------------
  26. There is also a tutorial notebook to try the debugger that is available on the `jupyter-ide-demo repo <https://github.com/blink1073/jupyter-ide-demo>`_.
  27. and can be run on Binder `here <https://mybinder.org/v2/gh/blink1073/jupyter-ide-demo/stable?urlpath=/lab/tree/index.ipynb>`_.
  28. .. image:: ./images/debugger/tutorial-notebook.png