debugger.rst 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. Here is a list of kernels that are known to be supporting the Jupyter Debug Protocol:
  10. - `xeus-python <https://github.com/jupyter-xeus/xeus-python>`_: Jupyter kernel for the Python programming language
  11. - `xeus-robot <https://github.com/jupyter-xeus/xeus-robot>`_: Jupyter kernel for Robot Framework
  12. Other Jupyter Kernels can also support debugging and be compatible with the JupyterLab debugger
  13. by implementing the `Jupyter Debugger Protocol <https://jupyter-client.readthedocs.io/en/latest/messaging.html#debug-request>`_.
  14. If you know of other kernels with support for debugging, please open a PR to add them to this list.
  15. Here is an example of how to install ``xeus-python`` in a new ``conda`` environment:
  16. .. code:: bash
  17. conda create -n jupyterlab-debugger -c conda-forge jupyterlab=3 xeus-python
  18. conda activate jupyterlab-debugger
  19. Usage
  20. -----
  21. ``xeus-python`` can be selected from the JupyterLab launcher:
  22. .. image:: ./images/debugger/xpython-launcher.png
  23. Alternatively, it is also possible to switch to the `xpython` kernel using the kernel selection dialog:
  24. .. image:: ./images/debugger/kernel-selection.gif
  25. Enable the debugger, set breakpoints and step into the code:
  26. .. image:: ./images/debugger/step.gif
  27. Tutorial Notebook
  28. -----------------
  29. 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>`_.
  30. and can be run on Binder `here <https://mybinder.org/v2/gh/blink1073/jupyter-ide-demo/stable?urlpath=/lab/tree/index.ipynb>`_.
  31. .. image:: ./images/debugger/tutorial-notebook.png