40

I love Jupyter's Notebook, however, it prints many, many updates to the terminal it was started from. For e.g., every time a file is saved manually or automatically, a line is printed. It makes the terminal virtually useless.

How do I stop it?

desertnaut
  • 46,107
  • 19
  • 109
  • 140
saud
  • 663
  • 1
  • 7
  • 16
  • http://stackoverflow.com/questions/14992278/supress-messages-from-ipython-notebook-engine?rq=1 – iayork Nov 06 '15 at 17:25
  • I tried: 'ipython notebook --no-browser --port=443 2> /dev/null > /dev/null' but it did not work. In fact, no notebook is opened. Even tried it without the '--no-browser' option. – saud Nov 06 '15 at 17:36
  • Start with `jupyter notebook >/dev/null 2>&1` and read up on dev/null redirection – iayork Nov 06 '15 at 17:39
  • 1
    ... that said, I suggest you not try to suppress the output messages. They don't render the terminal unusable, just one window of the terminal -- simply open other windows for other work. Meanwhile the messages that are output from the Jupyter notebook are potentially important and are worth at least glancing at in case of warnings or errors. – iayork Nov 06 '15 at 17:43
  • 1
    Possible duplicate of [Hide all warnings in ipython](https://stackoverflow.com/questions/9031783/hide-all-warnings-in-ipython) – desertnaut Oct 04 '17 at 10:54

4 Answers4

61
import warnings; warnings.simplefilter('ignore')

This would help you get rid of normal warnings.

Qijun Liu
  • 1,445
  • 1
  • 11
  • 11
11

You can easily disable the warnings permantently by just adding the following code:

import warnings
warnings.filterwarnings('ignore')

to the following file:

~/.ipython/profile_default/startup/disable-warnings.py
Rene B.
  • 3,421
  • 3
  • 28
  • 49
2

Add following on top of your code,

import warnings;
warnings.filterwarnings('ignore');
1

You Should try this: import warnings warnings.filterwarnings('ignore')