[BUG] Tracebacks don't seem to work in JupyterLab
See original GitHub issueRead the docs
There doesnโt seem to be an indicator that this wouldnโt work.
Describe the bug
The traceback handler doesnโt seem to do anything in IPython or xeus-python in Jupyter.
To Reproduce
import rich.traceback
rich.traceback.install(show_locals=True)
1 / 0
I feel like this might have worked in the recent past? At least I know I tried it and I thought I was in Jupyter, since I like to play around there. But itโs not working now, certainly. It works in the regular REPL.
Platform macOS, JupyterLab 3, rich 9.8.0
Diagnose
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ <class 'rich.console.Console'> โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ A high level console interface. โ
โ โ
โ โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ โ
โ โ <console width=183 ColorSystem.TRUECOLOR> โ โ
โ โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ โ
โ โ
โ color_system = 'truecolor' โ
โ encoding = 'utf-8' โ
โ file = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'> โ
โ is_dumb_terminal = False โ
โ is_jupyter = False โ
โ is_terminal = True โ
โ legacy_windows = False โ
โ no_color = False โ
โ options = ConsoleOptions(legacy_windows=False, min_width=1, max_width=183, is_terminal=True, encoding='utf-8', justify=None, overflow=None, no_wrap=False, highlight=None) โ
โ record = False โ
โ safe_box = True โ
โ size = ConsoleDimensions(width=183, height=73) โ
โ soft_wrap = False โ
โ stderr = False โ
โ style = None โ
โ tab_size = 8 โ
โ width = 183 โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
platform="Darwin"
WindowsConsoleFeatures(vt=False, truecolor=False)
rich @ file:///Users/runner/miniforge3/conda-bld/rich_1610416263198/work
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
[BUG] Tracebacks don't seem to work in JupyterLab ยท Issue #913
Read the docs There doesn't seem to be an indicator that this wouldn't work. Describe the bug The traceback handler doesn't seem to...
Read more >How to hide the error traceback in Jupyter Lab/Notebook?
Is this what you are looking for. Paste it in the 1st cell of your notebook and try to run it. Share. Share...
Read more >What to do when things go wrong - The Jupyter Notebook
Check that you have the latest version of any packages that look relevant. Unfortunately it's not always easy to figure out what packages...
Read more >Jupyter notebooks โ friendly-traceback 0.3.142 documentation
To use friendly, we use a special import statement. Tracebacks shown by friendly do not have a pink background. Note how the โfileโ...
Read more >Jupyter lab do not work "LoadError: TypeError: in typeassert ...
I notebooks load normally, but when I try to run a cell, the [ ] to its left is just blank, no number...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@henryiii This work now. Thanks to @nathanrpage97
You might be able to get Rich to work in this case using monkeypatching with just a two lines of code (redefinint
shell.InteractiveShell.showtraceback
andshell.InteractiveShell.showsyntaxerror
. See https://github.com/aroberge/friendly-traceback/blob/master/friendly_traceback/ipython.py for an example.