'Problems importing request and session from flask

VS Code is not recognizing import requests and session from flask. When I write the code it initializes request and session as variables.

I have pip uninstalled and reinstalled flask 2.1. I’m using VS Code for IDE and running MacBook Pro M1. Why do I have this problem?

Picture of the code



Solution 1:[1]

In the Integrated Terminal, run the app by entering , which runs the Flask development server. The development server looks for by default. When you run Flask, you should see output similar to the following:python -m flask runapp.py

To open your default browser to the rendered page, Ctrl+click the URL in the terminal.http://127.0.0.1:5000/

You can refer to the document of flask in vscode for more details

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 MingJie-MSFT