Categories
Python Answers

How to install Python Flask on Windows?

Spread the love

Sometimes, we want to install Python Flask on Windows.

In this article, we’ll look at how to install Python Flask on Windows.

How to install Python Flask on Windows?

To install Python Flask on Windows, we install the flask package with pip.

To install it, we run

pip install Flask

Then we create the app.py file and write

from flask import Flask
app = Flask(__name__)

@app.route("/")
def hello():
    return "Hello World!"

if __name__ == "__main__":
    app.run()

to create a simple app.

And then we run it by going to the Flask app project directory and run

python app.py

Conclusion

To install Python Flask on Windows, we install the flask package with pip.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *