debugger.rst 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. - `ipykernel <https://github.com/ipython/ipykernel>`_: IPython Kernel for Jupyter
  13. Other Jupyter Kernels can also support debugging and be compatible with the JupyterLab debugger
  14. by implementing the `Jupyter Debugger Protocol <https://jupyter-client.readthedocs.io/en/latest/messaging.html#debug-request>`_.
  15. If you know of other kernels with support for debugging, please open a PR to add them to this list.
  16. Here is an example of how to install ``ipykernel`` and ``xeus-python`` in a new ``conda`` environment:
  17. .. code:: bash
  18. conda create -n jupyterlab-debugger -c conda-forge jupyterlab=3 "ipykernel>=6" xeus-python
  19. conda activate jupyterlab-debugger
  20. Usage
  21. -----
  22. For Python, both ``ipykernel`` (6.0+) and ``xeus-python`` support debugging.
  23. Enable the debugger, set breakpoints and step into the code:
  24. .. image:: ./images/debugger/step.gif
  25. Tutorial Notebook
  26. -----------------
  27. 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>`_.
  28. and can be run on Binder `here <https://mybinder.org/v2/gh/blink1073/jupyter-ide-demo/stable?urlpath=/lab/tree/index.ipynb>`_.
  29. .. image:: ./images/debugger/tutorial-notebook.png