question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warnings are not shown in the Notebook editor

See original GitHub issue

Bug: Notebook Editor, Interactive Window, Editor cells

Warnings are not shown in the Notebook Editor.

Steps to cause the bug to occur

  1. If I run the following code in a .py from terminal, I get the warning message, but if I run it inside a cell in the Notebook editor, nothing appears.

import warnings  
warnings.warn('Warning Message') 

Actual behavior

Expected behavior

Your Jupyter and/or Python environment

Please provide as much info as you readily know

  • Jupyter server running: Local
  • Extension version: 2020.5.80290
  • VS Code version: 1.45.1
  • Setting python.jediEnabled: false
  • **Python version: Python 3.8.0
  • OS: Windows | Mac | Linux (distro): Linux (Ubuntu)
  • Virtual environment: conda | venv | virtualenv | N/A | … venv

Developer Tools Console Output

Microsoft Data Science for VS Code Engineering Team: @rchiodo, @IanMatthewHuff, @DavidKutu, @DonJayamanne, @greazer

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:18
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

8reactions
ashtoucommented, May 27, 2020

@IanMatthewHuff thanks. Yes, please do. Data-science packages often provide important warnings. For anyone else who might face the same problem, you’ll need to use warnings.simplefilter(action="default") in the notebooks for now.

5reactions
DavidRuhecommented, Oct 11, 2020

You can automatically do this for every notebook or interactive window by adding the following to settings.json

    "python.dataScience.runStartupCommands": 
        ["import warnings", 
        "warnings.simplefilter(action='default')"
    ]
Read more comments on GitHub >

github_iconTop Results From Across the Web

Warnings are not shown in the Notebook editor #1312 - GitHub
A warning is shown in a jupyter notebook, but not in our notebook editor view. We'll triage this issue.
Read more >
Stop Jupyter Notebook from printing warnings / status updates ...
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...
Read more >
How to Turn off Warnings in JupyterLab(Jupyter Notebook)
This article explains how to turn off warnings in JupyterLab and Jupyter Notebook. JupyterLab warnings can be extremely useful and prevent unexpected ...
Read more >
Editor not loading | Data Science and Machine Learning
Whenever I try to edit my kernel, it keeps showing editor loading but not really showing anything for several minutes. Is it only...
Read more >
Warning when a notebook is in an offline location - Office
This notebook may not sync correctly because Windows Offline Files is enabled on this folder. Click here to share this notebook to a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found