saud
saud

Reputation: 793

Stop Jupyter Notebook from printing warnings / status updates to the terminal

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?

Upvotes: 47

Views: 72462

Answers (5)

Rene B.
Rene B.

Reputation: 7364

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

Upvotes: 14

Anuruddha Thennakoon
Anuruddha Thennakoon

Reputation: 477

Add the following on the top of your code,

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

Upvotes: 1

Amarjeet Singh
Amarjeet Singh

Reputation: 23

You should try this:

import warnings

warnings.filterwarnings('ignore')

Upvotes: 0

J R
J R

Reputation: 579

3 lines ...

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

Upvotes: 0

Qijun Liu
Qijun Liu

Reputation: 1745

import warnings; warnings.simplefilter('ignore')

This would help you get rid of normal warnings.

Upvotes: 70

Related Questions