Menu Close

How to install Python Flask on Windows?

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.

Posted in Python, Python Answers