SOLVED : Import “flask” could not be resolved from sourcePylance in Python

Table of Contents


Import “flask” could not be resolved from sourcePylance

It is showing this error , but we have installed Flask.


This error is coming because , Flask is not installed in the current environment .

To check , in which environment Flask is installed , give the command –

pip --version

When you will give this command in terminal than it appears similar to like this –

It is showing that pip is in python 3.8 version , but we are using here 3.9 version of python as shwn below –

Click on left hand side below that Python 3.9.5 and choose python 3.8 like below –

When you will choose python 3.8 or the environment in which your pip is installed from which you have installed flask, than error will be resolved.

Thank You for reading , enjoy your day.