I want to hide tracebacks in my Python code in Jupyter notebooks, so only the error type and message are displayed.
This answer suggests sys.tracebacklimit = 0
but trying that gave the following:
ERROR:root:Internal Python error in the inspect module. Below is the traceback from this internal error. ERROR:root:Internal Python error in the inspect module. Below is the traceback from this internal error. Traceback (most recent call last): AssertionError Traceback (most recent call last): AssertionError
That answer also suggests replacing sys.excepthook
with a custom function, but the traceback was still displayed.
How can I hide the traceback?