Jupyter Lab - Suppress Console Output

jupyter lab - suppress console output

You should rewrite your command like this:

$ jupyter lab >/dev/null 2>&1 &

And also is wise to add nohup to avoid stop of app if you logout

$ nohup jupyter lab >/dev/null 2>&1 &

How do you suppress output in Jupyter running IPython?

Add %%capture as the first line of the cell. eg

%%capture
print('Hello')
MyFunction()

This simply discards the output, but the %%capture magic can be used to save the output to a variable - consult the docs

What is the best way to suppress the spark output in the Jupyter notebook?

The modification of the notebook output comes from one of the changes made in the release 6.0.0 of ipykernel.

All outputs to stdout/stderr should now be captured, including subprocesses and output of compiled libraries (blas, lapack....). In notebook server, some outputs that would previously go to the notebooks logs will now both head to notebook logs and in notebooks outputs.

A subsequent fix provides a way to restore the previous behavior.
The fix consists in disabling the capture new behavior by turning it off through the capture_fd_output flag, see this comment for more detail.

You can configure it by turning it off in your ipython profile.

# create a default profile
ipython profile create
# turn off the capture flag
echo "c.IPKernelApp.capture_fd_output = False" >> \
"~/.ipython/profile_default/ipython_kernel_config.py"

That's it ! All the outputs from Java, Spark and Ivy will no more be displayed in the notebook but only in the logs.

Notes
  • It can also be done system-wide by putting ipython_kernel_config.py in the /etc/ipython/ directory, see the doc for more information.
  • For the record, here is the PR implementing this fix on Jupyter Docker Stacks.

Keyboard shortcut to clear cell output in Jupyter notebook

You can setup your own shortcut in the UI (for the latest master version):

Sample Image

This menu can be found in Help > Keyboard Shortcuts in any open notebook.



Related Topics



Leave a reply



Submit