- Firstly, create a virtual environment on your terminal.
- Then install Flask by running pip install flask.
- After installing, press CTRL+SHIFT+P.
- Search for Python Interpreter.
- Select your virtual environment.
The problem will be fixed. I have also faced the same issue, but I resolved it by following this procedure.
Answer from Md. Saroar Jahan on Stack Overflow- Firstly, create a virtual environment on your terminal.
- Then install Flask by running pip install flask.
- After installing, press CTRL+SHIFT+P.
- Search for Python Interpreter.
- Select your virtual environment.
The problem will be fixed. I have also faced the same issue, but I resolved it by following this procedure.
When I did not install the module "flask", I ran into the problem you described:

The reason is that the module "flask" is not installed in the Python environment we currently use in VSCode.
Please use the shortcut key Ctrl+Shift+` to open a new VSCode terminal, it will automatically enter the currently selected environment, and then use the command "pip show flask" to check the installation location of the module "flask":

If it still shows that the module could not be resolved, it is recommended that you reinstall the module "flask".
Not sure if this is the right place for this question. I'm trying to use flask in visual studio code and went through the process of installing it. When I try to import it, I get a message saying "Import 'flask' could not be resolved from the source Pylance(reportMissingModuleSource)". How can I fix this?
Does this stack overflow question solve your issue? https://stackoverflow.com/a/65802367/11591238
Open a terminal in your project dir. Vscide should nothing to do with getting flask working. I don’t know how your env is configured though.
‘pip install pipenv’
‘pip shell’
‘pipenv install flask’
You should be good to go. Pipenv is my new lover 💙💙
Hope this helps
python - Import "flask" could not be resolved Pylance - Stack Overflow
Import “flask”, "requests" and "dotenv"could not be resolved from source Pylance (reportMissingModuleSource)
reportMissingModuleSource: Even if the module is successfully installed, a warning will still be displayed in the output.
Python-Flask false possitive problem
Videos
Open the Command Palette (Ctrl+Shift+P), then select the Python: Select Interpreter. From the list, select the virtual environment in your project folder that starts with
.env.Run Terminal: Create New Integrated Terminal (Ctrl+Shift+` or from the Command Palette), which creates a terminal and automatically activates the virtual environment by running its activation script.
Install
sqlalchemyandmongoenginewith commandpip install. Once installing them successfully, there will intellisense when you import them and no warnings shown.

Besides, the folder .vscode is to store Workspace settings as well as debugging and task configurations.
To resolve the issue, perform the following steps:
- Open the Command Palette by pressing Ctrl+Shift+P on your keyboard.
- In the Command Palette, select Python: Clear Cache and Reload Window.