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.

Exception has occurred: ModuleNotFoundError

See original GitHub issue

maybe related to #12264

Environment data

  • VS Code version: 1.45.1
  • Extension version (available under the Extensions sidebar): 2020.5.2 (8 June 2020)
  • OS and version: Window 10 Version 1909 (OS Build 18363.836)
  • Python version (& distribution if applicable, e.g. Anaconda): 3.7.7
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): virtualenv

Expected behaviour

I am using vscode debugger as usual. But since yesterday, me and my coworkers started getting Exception has occurred: ModuleNotFoundError.

Actual behaviour

I started getting Exception has occurred: ModuleNotFoundError since around yesterday noon. I notice that that time coincide new version release time. https://github.com/microsoft/vscode-python/releases/tag/2020.5.86398

module_not_found

Steps to reproduce:

importerrorsimple

I extracted simple code to reproduce. Simple try except import can be used to reproduce error.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
int19hcommented, Jun 10, 2020

This is microsoft/debugpy#281

The bug is that the exception is reported incorrectly when it shouldn’t be, but it doesn’t actually break your app - if you press F5, it should continue running. To prevent it from being reported, uncheck “User-Unhandled Exceptions” in the Breakpoints pane in bottom left.

(You shouldn’t need to uncheck “Unhandled Exceptions”.)

2reactions
marluanespiritusantocommented, Jun 10, 2020

Same here… If you install the previous version: ms-python.python@2020.5.80290 it’s work. But is not the best way to solve it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix ModuleNotFoundError in python with Visual Studio ...
When understanding this, you should be able to resolve your exception: Exception has occurred: ModuleNotFoundError No module named 'clases'.
Read more >
ModuleNotFoundError: no module named Python Error [Fixed]
How to fix the ModuleNotFoundError in Python · 1. Make sure imported modules are installed · 2. Make sure modules are spelled correctly...
Read more >
Exception has occurred: ModuleNotFoundError No module ...
Hello, I've looked for duplicate issues and it appears this comes up frequently but in 9/10 cases, the issue is accidentally running python2 ......
Read more >
Python ModuleNotFoundError Solution - Career Karma
The ModuleNotFoundError is raised when Python cannot locate an error. The most common cause of this error is forgetting to install a module...
Read more >
Built-in Exceptions — Python 3.11.1 documentation
Raised when a Unicode-related encoding or decoding error occurs. It is a subclass of ValueError . UnicodeError has attributes that describe the encoding...
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