Missing imports Pylance(reportMissingImports)

Posted on October 15, 2023 • eddrichjanzzen

Import *** could not be resolved Pylance(reportMissingImports)

While working on Python projects with Docker or just simply any Python project, you may sometimes run into a warning indicating missing imports in Visual Studio Code.

import-could-not-be-resolved

You're quite sure you've installed these packages already before... 🤔

What could be happening here?

Sometimes it's because the wrong environment is being used. This could happen when the IDE is closed, and opened again. Sometimes the setting defaults back to the Global system Python, where the package has not been installed.

In cases like this, you may try updating the currently used Python interpreter at the bottom part of the screen to the one where the missing package had been installed.

For example:

change-interpreter

Hope this helped! 😄 👍

Home

Posts

Projects

Github

Contact

janzzen

Developed by Janzzen Ang powered by Vercel