You now in a
virtual environment look down in right corner
3.12.4('.venv': venv) This mean that you most first install Flask and Flask-SQLAlchemy into this environment and then load VS Code again.
Example.
G:\div_code\foobar λ python -m venv venv G:\div_code\foobar λ cd venv G:\div_code\foobar\venv λ G:\div_code\foobar\venv\Scripts\activate.bat G:\div_code\foobar\venv (venv) λ pip list Package Version ------- ------- pip 24.0
So now i make the environment the same as you most have done,and can install to it.
G:\div_code\foobar\venv (venv) λ pip install flask Collecting flask ..... Successfully installed Jinja2-3.1.4 MarkupSafe-2.1.5 Werkzeug-3.0.3 blinker-1.8.2 click-8.1.7 colorama-0.4.6 flask-3.0.3 itsdangerous-2.2.0 # Start VS Code G:\div_code\foobar\venv (venv) λ code .
When in VS Code now
import flask will work without any errors from Pylance.