48

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

How do I stop it?

5
  • stackoverflow.com/questions/14992278/… Commented Nov 6, 2015 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. Commented Nov 6, 2015 at 17:36
  • 1
    Start with jupyter notebook >/dev/null 2>&1 and read up on dev/null redirection Commented Nov 6, 2015 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. Commented Nov 6, 2015 at 17:43
  • 2
    Possible duplicate of Hide all warnings in ipython Commented Oct 4, 2017 at 10:54

5 Answers 5

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

This would help you get rid of normal warnings.

Sign up to request clarification or add additional context in comments.

1 Comment

This is not the answer!
14

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

import warnings warnings.filterwarnings('ignore') 

to the following file:

~/.ipython/profile_default/startup/disable-warnings.py 

1 Comment

This works great, as I don't need to embed the code into every and each script or session.
2

Add the following on the top of your code,

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

Comments

1

3 lines ...

import warnings warnings.filterwarnings('ignore') warnings.simplefilter('ignore') 

1 Comment

That is more than the other answers. Why is that necessary? Please respond by editing (changing) your answer, not here in comments (***************** without ***************** "Edit:", "Update:", or similar - the answer should appear as if it was written today).
1

You should try this:

import warnings warnings.filterwarnings('ignore') 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.